mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-19 00:31:00 +00:00
kube-proxy service cache don't treat ipMode proxy address as invalid
Change-Id: I4f79d4847943862dfd859325cdab075f62ef4707
This commit is contained in:
parent
c112a34642
commit
5c7529a6fc
@ -213,7 +213,19 @@ func (sct *ServiceChangeTracker) newBaseServiceInfo(port *v1.ServicePort, servic
|
||||
if ing.IP == "" {
|
||||
continue
|
||||
}
|
||||
if ipFamily := proxyutil.GetIPFamilyFromIP(ing.IP); ipFamily == sct.ipFamily && proxyutil.IsVIPMode(ing) {
|
||||
|
||||
// proxy mode load balancers do not need to track the IPs in the service cache
|
||||
// and they can also implement IP family translation, so no need to check if
|
||||
// the status ingress.IP and the ClusterIP belong to the same family.
|
||||
if !proxyutil.IsVIPMode(ing) {
|
||||
klog.V(4).InfoS("Service change tracker ignored the following load balancer ingress IP for given Service as it using Proxy mode",
|
||||
"ipFamily", sct.ipFamily, "loadBalancerIngressIP", ing.IP, "service", klog.KObj(service))
|
||||
continue
|
||||
}
|
||||
|
||||
// kube-proxy does not implement IP family translation, skip addresses with
|
||||
// different IP family
|
||||
if ipFamily := proxyutil.GetIPFamilyFromIP(ing.IP); ipFamily == sct.ipFamily {
|
||||
info.loadBalancerVIPs = append(info.loadBalancerVIPs, ing.IP)
|
||||
} else {
|
||||
invalidIPs = append(invalidIPs, ing.IP)
|
||||
|
Loading…
Reference in New Issue
Block a user