Skip to content

Commit

Permalink
Don't explicitly filter config.NodePortAddresses by IP family
Browse files Browse the repository at this point in the history
There's no need to do this any more: proxyutil.NodePortAddresses does
it itself.
  • Loading branch information
danwinship committed Jun 30, 2023
1 parent a74b9fd commit ebb0fdd
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions cmd/kube-proxy/app/server_others.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,6 @@ func (s *ProxyServer) createProxier(config *proxyconfigapi.KubeProxyConfiguratio
ipt[1] = iptInterface
}

nodePortAddresses := config.NodePortAddresses

if !ipt[0].Present() {
return nil, fmt.Errorf("iptables is not supported for primary IP family %q", primaryProtocol)
} else if !ipt[1].Present() {
Expand All @@ -125,7 +123,6 @@ func (s *ProxyServer) createProxier(config *proxyconfigapi.KubeProxyConfiguratio
badAddrs := npaByFamily[secondaryFamily]
if len(badAddrs) > 0 {
klog.InfoS("Ignoring --nodeport-addresses of the wrong family", "ipFamily", secondaryFamily, "addresses", badAddrs)
nodePortAddresses = npaByFamily[s.PrimaryIPFamily]
}
}

Expand Down Expand Up @@ -157,7 +154,7 @@ func (s *ProxyServer) createProxier(config *proxyconfigapi.KubeProxyConfiguratio
s.NodeIPs,
s.Recorder,
s.HealthzServer,
nodePortAddresses,
config.NodePortAddresses,
)
} else {
// Create a single-stack proxier if and only if the node does not support dual-stack (i.e, no iptables support).
Expand All @@ -183,7 +180,7 @@ func (s *ProxyServer) createProxier(config *proxyconfigapi.KubeProxyConfiguratio
s.NodeIPs[s.PrimaryIPFamily],
s.Recorder,
s.HealthzServer,
nodePortAddresses,
config.NodePortAddresses,
)
}

Expand Down Expand Up @@ -230,7 +227,7 @@ func (s *ProxyServer) createProxier(config *proxyconfigapi.KubeProxyConfiguratio
s.Recorder,
s.HealthzServer,
config.IPVS.Scheduler,
nodePortAddresses,
config.NodePortAddresses,
kernelHandler,
)
} else {
Expand Down Expand Up @@ -262,7 +259,7 @@ func (s *ProxyServer) createProxier(config *proxyconfigapi.KubeProxyConfiguratio
s.Recorder,
s.HealthzServer,
config.IPVS.Scheduler,
nodePortAddresses,
config.NodePortAddresses,
kernelHandler,
)
}
Expand Down

0 comments on commit ebb0fdd

Please sign in to comment.