mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-29 22:46:12 +00:00
Merge pull request #6141 from zmerlynn/master_by_name
GCE node salt: Use the master FQDN, not the master IP
This commit is contained in:
commit
7bbf526a1f
@ -324,15 +324,15 @@ EOF
|
||||
}
|
||||
|
||||
function salt-set-apiserver() {
|
||||
local kube_master_ip
|
||||
until kube_master_ip=$(getent hosts ${KUBERNETES_MASTER_NAME} | cut -f1 -d\ ); do
|
||||
local kube_master_fqdn
|
||||
until kube_master_fqdn=$(getent hosts ${KUBERNETES_MASTER_NAME} | awk '{ print $2 }'); do
|
||||
echo 'Waiting for DNS resolution of ${KUBERNETES_MASTER_NAME}...'
|
||||
sleep 3
|
||||
done
|
||||
|
||||
cat <<EOF >>/etc/salt/minion.d/grains.conf
|
||||
api_servers: '${kube_master_ip}'
|
||||
apiservers: '${kube_master_ip}'
|
||||
api_servers: '${kube_master_fqdn}'
|
||||
apiservers: '${kube_master_fqdn}'
|
||||
EOF
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user