Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IPVS: Add support for GetConfig/SetConfig #2349

Merged
merged 3 commits into from
Mar 13, 2019

Conversation

lbernail
Copy link
Contributor

GetConfig and SetConfig allow to change the IPVS connection timeouts for TCP, TCPFIN and UDP

We vendor libnetwork's ipvs library into kubernetes and we would like to change the default IPVS timeouts (and probably make them configurable).

It's my first PR in this repository, so of course don't hesitate to let me know if things should be done differently. I'm also happy to create an issue if necessary.

@GordonTheTurtle
Copy link

Please sign your commits following these rules:
https://github.com/moby/moby/blob/master/CONTRIBUTING.md#sign-your-work
The easiest way to do this is to amend the last commit:

$ git clone -b "lbernail/ipvs-timeouts" [email protected]:DataDog/libnetwork.git somewhere
$ cd somewhere
$ git rebase -i HEAD~842358786928
editor opens
change each 'pick' to 'edit'
save the file and quit
$ git commit --amend -s --no-edit
$ git rebase --continue # and repeat the amend for each commit
$ git push -f

Amending updates the existing PR. You DO NOT need to open a new one.

req := newIPVSRequest(ipvsCmdSetConfig)
req.Seq = atomic.AddUint32(&i.seq, 1)

req.AddData(nl.NewRtAttr(ipvsCmdAttrTimeoutTCP, nl.Uint32Attr(uint32(c.TimeoutTCP.Seconds()))))

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

isn't it better to make them conditional? what is the config does not specify all the 3 values? is the 0 value ignored by the kernel?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, 0 means "unchanged"
Extract from the ipvsdam man page:

--set tcp tcpfin udp
Change the timeout values used for IPVS connections. This command always takes 3 parameters, representing the timeout values (in seconds) for TCP sessions, TCP sessions after receiving a FIN packet, and UDP packets, respectively. A timeout value 0 means that the current timeout value of the corresponding entry is preserved.

But I can definitely add a test for this

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that would be great and maybe a comment saying that 0 means unchanged just for posterity, rest LGTM

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm doing it right now

Copy link

@fcrisciani fcrisciani left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@fcrisciani fcrisciani merged commit e4ef8fe into moby:master Mar 13, 2019
@fcrisciani
Copy link

thanks @lbernail merged!

@lbernail
Copy link
Contributor Author

That was very fast. Thanks a lot!

@lbernail lbernail deleted the lbernail/ipvs-timeouts branch March 14, 2019 08:12
thaJeztah added a commit to thaJeztah/docker that referenced this pull request Apr 1, 2019
full diff: moby/libnetwork@1a06131...ebcade7

relevant changes:

- moby/libnetwork#2349 IPVS: Add support for GetConfig/SetConfig
- moby/libnetwork#2343 Revert "debian has iptables-legacy and iptables-nft now"
- moby/libnetwork#2230 Moving IPVLAN driver out of experimental
- moby/libnetwork#2307 Fix for problem where agent is stopped and does not restart
- moby/libnetwork#2303 Touch-up error-message and godoc for ConfigVXLANUDPPort
- moby/libnetwork#2325 Fix possible nil pointer exception
- moby/libnetwork#2302 Use sync.RWMutex for VXLANUDPPort
- moby/libnetwork#2306 Improve error if auto-selecting IP-range failed

Signed-off-by: Sebastiaan van Stijn <[email protected]>
docker-jenkins pushed a commit to docker-archive/docker-ce that referenced this pull request Apr 3, 2019
full diff: moby/libnetwork@1a06131...ebcade7

relevant changes:

- moby/libnetwork#2349 IPVS: Add support for GetConfig/SetConfig
- moby/libnetwork#2343 Revert "debian has iptables-legacy and iptables-nft now"
- moby/libnetwork#2230 Moving IPVLAN driver out of experimental
- moby/libnetwork#2307 Fix for problem where agent is stopped and does not restart
- moby/libnetwork#2303 Touch-up error-message and godoc for ConfigVXLANUDPPort
- moby/libnetwork#2325 Fix possible nil pointer exception
- moby/libnetwork#2302 Use sync.RWMutex for VXLANUDPPort
- moby/libnetwork#2306 Improve error if auto-selecting IP-range failed

Signed-off-by: Sebastiaan van Stijn <[email protected]>
Upstream-commit: 3ab093d5670e8d59f6ae0c4604b8fcabf1582854
Component: engine
adhulipa pushed a commit to adhulipa/docker that referenced this pull request Apr 11, 2019
full diff: moby/libnetwork@1a06131...ebcade7

relevant changes:

- moby/libnetwork#2349 IPVS: Add support for GetConfig/SetConfig
- moby/libnetwork#2343 Revert "debian has iptables-legacy and iptables-nft now"
- moby/libnetwork#2230 Moving IPVLAN driver out of experimental
- moby/libnetwork#2307 Fix for problem where agent is stopped and does not restart
- moby/libnetwork#2303 Touch-up error-message and godoc for ConfigVXLANUDPPort
- moby/libnetwork#2325 Fix possible nil pointer exception
- moby/libnetwork#2302 Use sync.RWMutex for VXLANUDPPort
- moby/libnetwork#2306 Improve error if auto-selecting IP-range failed

Signed-off-by: Sebastiaan van Stijn <[email protected]>
kiku-jw pushed a commit to kiku-jw/moby that referenced this pull request May 16, 2019
full diff: moby/libnetwork@1a06131...ebcade7

relevant changes:

- moby/libnetwork#2349 IPVS: Add support for GetConfig/SetConfig
- moby/libnetwork#2343 Revert "debian has iptables-legacy and iptables-nft now"
- moby/libnetwork#2230 Moving IPVLAN driver out of experimental
- moby/libnetwork#2307 Fix for problem where agent is stopped and does not restart
- moby/libnetwork#2303 Touch-up error-message and godoc for ConfigVXLANUDPPort
- moby/libnetwork#2325 Fix possible nil pointer exception
- moby/libnetwork#2302 Use sync.RWMutex for VXLANUDPPort
- moby/libnetwork#2306 Improve error if auto-selecting IP-range failed

Signed-off-by: Sebastiaan van Stijn <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants