proxy/ipvs: don't bind nodeips to the dummy device

This commit is contained in:
Lars Ekman
2023-04-27 20:47:10 +02:00
parent ca1e563141
commit bbca939c66

View File

@@ -1192,9 +1192,13 @@ func (proxier *Proxier) syncProxyRules() {
if proxier.ipvsScheduler == "mh" {
serv.Flags |= utilipvs.FlagSourceHash
}
if err := proxier.syncService(svcPortNameString, serv, true, alreadyBoundAddrs); err == nil {
// We must not add the address to the dummy device if it exist on another interface
shouldBind := !nodeAddressSet.Has(serv.Address.String())
if err := proxier.syncService(svcPortNameString, serv, shouldBind, alreadyBoundAddrs); err == nil {
activeIPVSServices.Insert(serv.String())
activeBindAddrs.Insert(serv.Address.String())
if shouldBind {
activeBindAddrs.Insert(serv.Address.String())
}
if err := proxier.syncEndpoint(svcPortName, svcInfo.ExternalPolicyLocal(), serv); err != nil {
klog.ErrorS(err, "Failed to sync endpoint for service", "servicePortName", svcPortName, "virtualServer", serv)
}
@@ -1295,9 +1299,13 @@ func (proxier *Proxier) syncProxyRules() {
if proxier.ipvsScheduler == "mh" {
serv.Flags |= utilipvs.FlagSourceHash
}
if err := proxier.syncService(svcPortNameString, serv, true, alreadyBoundAddrs); err == nil {
// We must not add the address to the dummy device if it exist on another interface
shouldBind := !nodeAddressSet.Has(serv.Address.String())
if err := proxier.syncService(svcPortNameString, serv, shouldBind, alreadyBoundAddrs); err == nil {
activeIPVSServices.Insert(serv.String())
activeBindAddrs.Insert(serv.Address.String())
if shouldBind {
activeBindAddrs.Insert(serv.Address.String())
}
if err := proxier.syncEndpoint(svcPortName, svcInfo.ExternalPolicyLocal(), serv); err != nil {
klog.ErrorS(err, "Failed to sync endpoint for service", "servicePortName", svcPortName, "virtualServer", serv)
}