1
0
mirror of https://github.com/rancher/rke.git synced 2025-09-13 13:40:22 +00:00

delete hostname-override for aws cloud provider

aws cloud provider assigns private dns as the node name,
don't override it since it cannot be changed.
This commit is contained in:
Kinara Shah
2022-01-10 09:34:33 -08:00
parent 6efce927fb
commit eb8b278bcd

View File

@@ -472,7 +472,11 @@ func (c *Cluster) BuildKubeletProcess(host *hosts.Host, serviceOptions v3.Kubern
if host.IsWindows() { // compatible with Windows if host.IsWindows() { // compatible with Windows
CommandArgs["cloud-config"] = path.Join(host.PrefixPath, cloudConfigFileName) CommandArgs["cloud-config"] = path.Join(host.PrefixPath, cloudConfigFileName)
} }
if c.CloudProvider.Name == k8s.AWSCloudProvider {
delete(CommandArgs, "hostname-override")
}
} }
if c.IsKubeletGenerateServingCertificateEnabled() { if c.IsKubeletGenerateServingCertificateEnabled() {
CommandArgs["tls-cert-file"] = pki.GetCertPath(pki.GetCrtNameForHost(host, pki.KubeletCertName)) CommandArgs["tls-cert-file"] = pki.GetCertPath(pki.GetCrtNameForHost(host, pki.KubeletCertName))
CommandArgs["tls-private-key-file"] = pki.GetCertPath(fmt.Sprintf("%s-key", pki.GetCrtNameForHost(host, pki.KubeletCertName))) CommandArgs["tls-private-key-file"] = pki.GetCertPath(fmt.Sprintf("%s-key", pki.GetCrtNameForHost(host, pki.KubeletCertName)))
@@ -649,6 +653,9 @@ func (c *Cluster) BuildKubeProxyProcess(host *hosts.Host, serviceOptions v3.Kube
} else { } else {
CommandArgs["bind-address"] = host.Address CommandArgs["bind-address"] = host.Address
} }
if c.CloudProvider.Name == k8s.AWSCloudProvider {
delete(CommandArgs, "hostname-override")
}
} }
// Best security practice is to listen on localhost, but DinD uses private container network instead of Host. // Best security practice is to listen on localhost, but DinD uses private container network instead of Host.