mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-16 07:13:53 +00:00
proxy/ipvs: don't bind nodeips to the dummy device
This commit is contained in:
parent
5310305098
commit
5ece6541b8
@ -1169,9 +1169,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)
|
||||
}
|
||||
@ -1272,9 +1276,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)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user