cluster: allow providing KUBE_MASTER_IP env var

To avoid overhead of always querying gcloud.
pull/6/head
Daniel Norberg 2014-06-12 13:03:49 -04:00
parent 02d9cf2eb9
commit c74e04efea
1 changed files with 5 additions and 3 deletions

View File

@ -70,9 +70,11 @@ function detect-minions () {
function detect-master () {
KUBE_MASTER=${MASTER_NAME}
KUBE_MASTER_IP=$(gcloud compute instances get ${MASTER_NAME} \
--fields networkInterfaces[].accessConfigs[].natIP --format=text \
| tail -n 1 | cut -f 2 -d ' ')
if [ -z "$KUBE_MASTER_IP" ]; then
KUBE_MASTER_IP=$(gcloud compute instances get ${MASTER_NAME} \
--fields networkInterfaces[].accessConfigs[].natIP --format=text \
| tail -n 1 | cut -f 2 -d ' ')
fi
if [ -z "$KUBE_MASTER_IP" ]; then
echo "Could not detect Kubernetes master node. Make sure you've launched a cluster with 'kube-up.sh'"
exit 1