IPVS: Add support for GetConfig/SetConfig#2349
Conversation
|
Please sign your commits following these rules: $ 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 -fAmending updates the existing PR. You DO NOT need to open a new one. |
Signed-off-by: Laurent Bernaille <[email protected]>
Signed-off-by: Laurent Bernaille <[email protected]>
81a2daf to
3e62b8b
Compare
| req := newIPVSRequest(ipvsCmdSetConfig) | ||
| req.Seq = atomic.AddUint32(&i.seq, 1) | ||
|
|
||
| req.AddData(nl.NewRtAttr(ipvsCmdAttrTimeoutTCP, nl.Uint32Attr(uint32(c.TimeoutTCP.Seconds())))) |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
There was a problem hiding this comment.
that would be great and maybe a comment saying that 0 means unchanged just for posterity, rest LGTM
There was a problem hiding this comment.
I'm doing it right now
Signed-off-by: Laurent Bernaille <[email protected]>
|
thanks @lbernail merged! |
|
That was very fast. Thanks a lot! |
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]>
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
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]>
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.