mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-28 14:07:14 +00:00
Merge pull request #75 from danielnorberg/dano/cluster-kube-master-env
cluster: allow providing KUBE_MASTER_IP env var
This commit is contained in:
commit
07beeea50f
@ -70,9 +70,11 @@ function detect-minions () {
|
|||||||
|
|
||||||
function detect-master () {
|
function detect-master () {
|
||||||
KUBE_MASTER=${MASTER_NAME}
|
KUBE_MASTER=${MASTER_NAME}
|
||||||
|
if [ -z "$KUBE_MASTER_IP" ]; then
|
||||||
KUBE_MASTER_IP=$(gcloud compute instances get ${MASTER_NAME} \
|
KUBE_MASTER_IP=$(gcloud compute instances get ${MASTER_NAME} \
|
||||||
--fields networkInterfaces[].accessConfigs[].natIP --format=text \
|
--fields networkInterfaces[].accessConfigs[].natIP --format=text \
|
||||||
| tail -n 1 | cut -f 2 -d ' ')
|
| tail -n 1 | cut -f 2 -d ' ')
|
||||||
|
fi
|
||||||
if [ -z "$KUBE_MASTER_IP" ]; then
|
if [ -z "$KUBE_MASTER_IP" ]; then
|
||||||
echo "Could not detect Kubernetes master node. Make sure you've launched a cluster with 'kube-up.sh'"
|
echo "Could not detect Kubernetes master node. Make sure you've launched a cluster with 'kube-up.sh'"
|
||||||
exit 1
|
exit 1
|
||||||
|
Loading…
Reference in New Issue
Block a user