mirror of
https://github.com/k3s-io/kubernetes.git
synced 2026-07-21 08:47:16 +00:00
proxy/ipvs: don't bind nodeips to the dummy device
This commit is contained in:
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user