Add debugging output when trying to find the name of the master.

This commit is contained in:
Matt Liggett 2016-08-23 13:18:22 -07:00
parent d8a81155c8
commit 2ddc08e567

View File

@ -386,15 +386,18 @@ function detect-nodes() {
function detect-master() {
detect-project
KUBE_MASTER=${MASTER_NAME}
echo "Trying to find master named '${MASTER_NAME}'" >&2
if [[ -z "${KUBE_MASTER_IP-}" ]]; then
KUBE_MASTER_IP=$(gcloud compute addresses describe "${MASTER_NAME}-ip" \
local master_address_name="${MASTER_NAME}-ip"
echo "Looking for address '${master_address_name}'" >&2
KUBE_MASTER_IP=$(gcloud compute addresses describe "${master_address_name}" \
--project "${PROJECT}" --region "${REGION}" -q --format='value(address)')
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'" >&2
exit 1
fi
echo "Using master: $KUBE_MASTER (external IP: $KUBE_MASTER_IP)"
echo "Using master: $KUBE_MASTER (external IP: $KUBE_MASTER_IP)" >&2
}
# Reads kube-env metadata from master