Is this a BUG REPORT or FEATURE REQUEST?:
/kind bug
What happened:
IPVS proxier keep logging the following message, that is, IPVS proxier keeps updating virtual servers even if no service changes.
I0912 17:08:13.555614 18274 proxier.go:1279] vs is: &ipvs.VirtualServer{Address:net.IP{0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff, 0xa, 0x0, 0x0, 0x1}, Protocol:"TCP", Port:0x1bb, Scheduler:"rr", Flags:0x1, Timeout:0x2a30}, applied vs is : &ipvs.VirtualServer{Address:net.IP{0xa, 0x0, 0x0, 0x1}, Protocol:"TCP", Port:0x1bb, Scheduler:"rr", Flags:0x3, Timeout:0x2a30}
I0912 17:08:13.555659 18274 proxier.go:1291] IPVS service default/kubernetes:https was changed
I0912 17:08:13.556787 18274 proxier.go:1279] vs is: &ipvs.VirtualServer{Address:net.IP{0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff, 0xa, 0x0, 0x0, 0xa}, Protocol:"UDP", Port:0x35, Scheduler:"rr", Flags:0x0, Timeout:0x0}, applied vs is : &ipvs.VirtualServer{Address:net.IP{0xa, 0x0, 0x0, 0xa}, Protocol:"UDP", Port:0x35, Scheduler:"rr", Flags:0x2, Timeout:0x0}
I0912 17:08:13.556818 18274 proxier.go:1291] IPVS service kube-system/kube-dns:dns was changed
I0912 17:08:13.557872 18274 proxier.go:1279] vs is: &ipvs.VirtualServer{Address:net.IP{0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff, 0xa, 0x0, 0x0, 0xa}, Protocol:"TCP", Port:0x35, Scheduler:"rr", Flags:0x0, Timeout:0x0}, applied vs is : &ipvs.VirtualServer{Address:net.IP{0xa, 0x0, 0x0, 0xa}, Protocol:"TCP", Port:0x35, Scheduler:"rr", Flags:0x2, Timeout:0x0}
I0912 17:08:13.557902 18274 proxier.go:1291] IPVS service kube-system/kube-dns:dns-tcp was changed
I0912 17:08:13.558940 18274 proxier.go:1279] vs is: &ipvs.VirtualServer{Address:net.IP{0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff, 0xa, 0x0, 0x0, 0xb6}, Protocol:"TCP", Port:0xbda, Scheduler:"rr", Flags:0x1, Timeout:0x2a30}, applied vs is : &ipvs.VirtualServer{Address:net.IP{0xa, 0x0, 0x0, 0xb6}, Protocol:"TCP", Port:0xbda, Scheduler:"rr", Flags:0x3, Timeout:0x2a30}
....
I0912 17:09:13.455862 18274 proxier.go:1279] vs is: &ipvs.VirtualServer{Address:net.IP{0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff, 0xa, 0x0, 0x0, 0x1}, Protocol:"TCP", Port:0x1bb, Scheduler:"rr", Flags:0x1, Timeout:0x2a30}, applied vs is : &ipvs.VirtualServer{Address:net.IP{0xa, 0x0, 0x0, 0x1}, Protocol:"TCP", Port:0x1bb, Scheduler:"rr", Flags:0x3, Timeout:0x2a30}
I0912 17:09:13.455894 18274 proxier.go:1291] IPVS service default/kubernetes:https was changed
I0912 17:09:13.457139 18274 proxier.go:1279] vs is: &ipvs.VirtualServer{Address:net.IP{0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff, 0xa, 0x0, 0x0, 0xa}, Protocol:"UDP", Port:0x35, Scheduler:"rr", Flags:0x0, Timeout:0x0}, applied vs is : &ipvs.VirtualServer{Address:net.IP{0xa, 0x0, 0x0, 0xa}, Protocol:"UDP", Port:0x35, Scheduler:"rr", Flags:0x2, Timeout:0x0}
I0912 17:09:13.457169 18274 proxier.go:1291] IPVS service kube-system/kube-dns:dns was changed
I0912 17:09:13.458292 18274 proxier.go:1279] vs is: &ipvs.VirtualServer{Address:net.IP{0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff, 0xa, 0x0, 0x0, 0xa}, Protocol:"TCP", Port:0x35, Scheduler:"rr", Flags:0x0, Timeout:0x0}, applied vs is : &ipvs.VirtualServer{Address:net.IP{0xa, 0x0, 0x0, 0xa}, Protocol:"TCP", Port:0x35, Scheduler:"rr", Flags:0x2, Timeout:0x0}
I0912 17:09:13.458322 18274 proxier.go:1291] IPVS service kube-system/kube-dns:dns-tcp was changed
I0912 17:09:13.459468 18274 proxier.go:1279] vs is: &ipvs.VirtualServer{Address:net.IP{0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff, 0xa, 0x0, 0x0, 0xb6}, Protocol:"TCP", Port:0xbda, Scheduler:"rr", Flags:0x1, Timeout:0x2a30}, applied vs is : &ipvs.VirtualServer{Address:net.IP{0xa, 0x0, 0x0, 0xb6}, Protocol:"TCP", Port:0xbda, Scheduler:"rr", Flags:0x3, Timeout:0x2a30}
...
PS. I added some logs to print the IPVS virtual server information.
What you expected to happen:
IPVS proxier should NOT update virtual server when no service changes.
How to reproduce it (as minimally and precisely as possible):
Just check the log message, you will find it.
Anything else we need to know?:
I think that's because the IPVS service flags differs. For example, create an IPVS service with Flags = 0, the Flags of created service will change to (0+2=2). Besides, if we create an IPVS service with Flags = 1, then the Flags of created service will change to (1+2=3).
See related issue: https://github.com/docker/libnetwork/issues/1921
Environment:
kubectl version
):uname -a
):/sig network
/assign @m1093782566
/cc @choury @Lion-Wei
Most helpful comment
/cc @choury @Lion-Wei