diff --git a/pkg/proxy/iptables/proxier.go b/pkg/proxy/iptables/proxier.go index 044b047eb4c..311ef58d04b 100644 --- a/pkg/proxy/iptables/proxier.go +++ b/pkg/proxy/iptables/proxier.go @@ -649,7 +649,17 @@ func (proxier *Proxier) OnEndpointsUpdate(allEndpoints []api.Endpoints) { staleConnections[endpointServicePair{endpoint: ep.ip, servicePortName: svcPort}] = true } } + } + // Update service health check + allSvcPorts := make(map[proxy.ServicePortName]bool) + for svcPort := range proxier.endpointsMap { + allSvcPorts[svcPort] = true + } + for svcPort := range newEndpointsMap { + allSvcPorts[svcPort] = true + } + for svcPort := range allSvcPorts { proxier.updateHealthCheckEntries(svcPort.NamespacedName, svcPortToInfoMap[svcPort]) }