Fix kube-proxy logic to change iptables chains when ESIPP is turned on or off
This commit is contained in:
parent
c9fde2ba8a
commit
d3a1510e02
@ -346,6 +346,10 @@ func (proxier *Proxier) sameConfig(info *serviceInfo, service *api.Service, port
|
|||||||
if info.sessionAffinityType != service.Spec.SessionAffinity {
|
if info.sessionAffinityType != service.Spec.SessionAffinity {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
onlyNodeLocalEndpoints := apiservice.NeedsHealthCheck(service) && featuregate.DefaultFeatureGate.ExternalTrafficLocalOnly()
|
||||||
|
if info.onlyNodeLocalEndpoints != onlyNodeLocalEndpoints {
|
||||||
|
return false
|
||||||
|
}
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -446,6 +450,9 @@ func (proxier *Proxier) OnServiceUpdate(allServices []api.Service) {
|
|||||||
// Turn on healthcheck responder to listen on the health check nodePort
|
// Turn on healthcheck responder to listen on the health check nodePort
|
||||||
healthcheck.AddServiceListener(serviceName.NamespacedName, info.healthCheckNodePort)
|
healthcheck.AddServiceListener(serviceName.NamespacedName, info.healthCheckNodePort)
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
// Delete healthcheck responders, if any, previously listening for this service
|
||||||
|
healthcheck.DeleteServiceListener(serviceName.NamespacedName, 0)
|
||||||
}
|
}
|
||||||
proxier.serviceMap[serviceName] = info
|
proxier.serviceMap[serviceName] = info
|
||||||
|
|
||||||
@ -895,6 +902,9 @@ func (proxier *Proxier) syncProxyRules() {
|
|||||||
writeLine(natChains, utiliptables.MakeChainLine(svcXlbChain))
|
writeLine(natChains, utiliptables.MakeChainLine(svcXlbChain))
|
||||||
}
|
}
|
||||||
activeNATChains[svcXlbChain] = true
|
activeNATChains[svcXlbChain] = true
|
||||||
|
} else if activeNATChains[svcXlbChain] {
|
||||||
|
// Cleanup the previously created XLB chain for this service
|
||||||
|
delete(activeNATChains, svcXlbChain)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Capture the clusterIP.
|
// Capture the clusterIP.
|
||||||
|
Loading…
Reference in New Issue
Block a user