From 7a2e6497452cddbb9981f40165cc06555402872f Mon Sep 17 00:00:00 2001 From: Matt Liggett Date: Thu, 11 Feb 2016 14:05:07 -0800 Subject: [PATCH] Include some debug output when the API server never appears. Helps with #20916 --- cluster/gce/util.sh | 12 ++++++++++++ hack/e2e-internal/e2e-up.sh | 2 +- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/cluster/gce/util.sh b/cluster/gce/util.sh index 77dd2f15a01..853f16c9d22 100755 --- a/cluster/gce/util.sh +++ b/cluster/gce/util.sh @@ -744,6 +744,18 @@ function check-cluster() { local elapsed=$(($(date +%s) - ${start_time})) if [[ ${elapsed} -gt ${KUBE_CLUSTER_INITIALIZATION_TIMEOUT} ]]; then echo -e "${color_red}Cluster failed to initialize within ${KUBE_CLUSTER_INITIALIZATION_TIMEOUT} seconds.${color_norm}" >&2 + if [[ ${KUBE_TEST_DEBUG-} =~ ^[yY]$ ]]; then + local tmp_log="$(mktemp)" + local file + for file in /var/log/startupscript.log /var/log/kube-apiserver.log; do + echo "${MASTER_NAME}:${file} contents:" + if gcloud compute copy-files --project "${PROJECT}" \ + --zone "${ZONE}" "${MASTER_NAME}:${file}" "${tmp_log}"; then + cat "${tmp_log}" + fi + done + rm -f "${tmp_log}" + fi exit 2 fi printf "." diff --git a/hack/e2e-internal/e2e-up.sh b/hack/e2e-internal/e2e-up.sh index c39593da3df..de7aa5734bc 100755 --- a/hack/e2e-internal/e2e-up.sh +++ b/hack/e2e-internal/e2e-up.sh @@ -31,5 +31,5 @@ source "${KUBE_VERSION_ROOT}/cluster/${KUBERNETES_PROVIDER}/util.sh" prepare-e2e -"${KUBE_VERSION_ROOT}/cluster/kube-up.sh" +KUBE_TEST_DEBUG=y "${KUBE_VERSION_ROOT}/cluster/kube-up.sh" test-setup