From b6b3a692843680b4b02c759402f9cccc1a054a19 Mon Sep 17 00:00:00 2001 From: Lars Ekman Date: Wed, 19 May 2021 08:27:24 +0200 Subject: [PATCH] Don't set sysctl net.ipv4.vs.conn_reuse_mode for kernels >=5.9 --- pkg/proxy/ipvs/proxier.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pkg/proxy/ipvs/proxier.go b/pkg/proxy/ipvs/proxier.go index 315f0060f1f..9b1a076f7a9 100644 --- a/pkg/proxy/ipvs/proxier.go +++ b/pkg/proxy/ipvs/proxier.go @@ -91,6 +91,9 @@ const ( DefaultDummyDevice = "kube-ipvs0" connReuseMinSupportedKernelVersion = "4.1" + + // https://github.com/torvalds/linux/commit/35dfb013149f74c2be1ff9c78f14e6a3cd1539d1 + connReuseFixedKernelVersion = "5.9" ) // iptablesJumpChain is tables of iptables chains that ipvs proxier used to install iptables or cleanup iptables. @@ -376,6 +379,9 @@ func NewProxier(ipt utiliptables.Interface, } if kernelVersion.LessThan(version.MustParseGeneric(connReuseMinSupportedKernelVersion)) { klog.ErrorS(nil, fmt.Sprintf("can't set sysctl %s, kernel version must be at least %s", sysctlConnReuse, connReuseMinSupportedKernelVersion)) + } else if kernelVersion.AtLeast(version.MustParseGeneric(connReuseFixedKernelVersion)) { + // https://github.com/kubernetes/kubernetes/issues/93297 + klog.V(2).InfoS("Left as-is", "sysctl", sysctlConnReuse) } else { // Set the connection reuse mode if err := utilproxy.EnsureSysctl(sysctl, sysctlConnReuse, 0); err != nil {