mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-28 05:57:25 +00:00
Get ipv6 nodeIP when in ipv6 cluster
This commit is contained in:
parent
bababe08f6
commit
69398f8411
@ -136,12 +136,12 @@ func newProxyServer(
|
|||||||
var endpointsEventHandler proxyconfig.EndpointsHandler
|
var endpointsEventHandler proxyconfig.EndpointsHandler
|
||||||
|
|
||||||
proxyMode := getProxyMode(string(config.Mode), iptInterface, kernelHandler, ipsetInterface, iptables.LinuxKernelCompatTester{})
|
proxyMode := getProxyMode(string(config.Mode), iptInterface, kernelHandler, ipsetInterface, iptables.LinuxKernelCompatTester{})
|
||||||
|
nodeIP := net.ParseIP(config.BindAddress)
|
||||||
|
if nodeIP.IsUnspecified() {
|
||||||
|
nodeIP = getNodeIP(client, hostname)
|
||||||
|
}
|
||||||
if proxyMode == proxyModeIPTables {
|
if proxyMode == proxyModeIPTables {
|
||||||
glog.V(0).Info("Using iptables Proxier.")
|
glog.V(0).Info("Using iptables Proxier.")
|
||||||
nodeIP := net.ParseIP(config.BindAddress)
|
|
||||||
if nodeIP.Equal(net.IPv4zero) || nodeIP.Equal(net.IPv6zero) {
|
|
||||||
nodeIP = getNodeIP(client, hostname)
|
|
||||||
}
|
|
||||||
if config.IPTables.MasqueradeBit == nil {
|
if config.IPTables.MasqueradeBit == nil {
|
||||||
// MasqueradeBit must be specified or defaulted.
|
// MasqueradeBit must be specified or defaulted.
|
||||||
return nil, fmt.Errorf("unable to read IPTables MasqueradeBit from config")
|
return nil, fmt.Errorf("unable to read IPTables MasqueradeBit from config")
|
||||||
@ -194,7 +194,7 @@ func newProxyServer(
|
|||||||
int(*config.IPTables.MasqueradeBit),
|
int(*config.IPTables.MasqueradeBit),
|
||||||
config.ClusterCIDR,
|
config.ClusterCIDR,
|
||||||
hostname,
|
hostname,
|
||||||
getNodeIP(client, hostname),
|
nodeIP,
|
||||||
recorder,
|
recorder,
|
||||||
healthzServer,
|
healthzServer,
|
||||||
config.IPVS.Scheduler,
|
config.IPVS.Scheduler,
|
||||||
|
Loading…
Reference in New Issue
Block a user