diff --git a/cluster/plan.go b/cluster/plan.go index f122962a..a06f03ae 100644 --- a/cluster/plan.go +++ b/cluster/plan.go @@ -585,6 +585,14 @@ func (c *Cluster) BuildKubeProxyProcess(host *hosts.Host, prefixPath string, svc CommandArgs[k] = v } } + // If cloudprovider is set (not empty), set the bind address because the node will not be able to retrieve it's IP address in case cloud provider changes the node object name (i.e. AWS and Openstack) + if c.CloudProvider.Name != "" { + if host.InternalAddress != "" && host.Address != host.InternalAddress { + CommandArgs["bind-address"] = host.InternalAddress + } else { + CommandArgs["bind-address"] = host.Address + } + } // Best security practice is to listen on localhost, but DinD uses private container network instead of Host. if c.DinD {