mirror of
https://github.com/rancher/rke.git
synced 2025-05-10 17:35:03 +00:00
Provide IP for kube-proxy if cloudprovider is set
If cloudprovider is set (not empty), set the bind address because the node will not be able to retrieve it's IP address because the nodename could be set by the cloud provider (e.g. AWS and Openstack)
This commit is contained in:
parent
6b7a725ec1
commit
7c4c1324f9
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user