diff --git a/cluster/mesos/docker/config-default.sh b/cluster/mesos/docker/config-default.sh index ebee2f1cbed..ab2482d0917 100755 --- a/cluster/mesos/docker/config-default.sh +++ b/cluster/mesos/docker/config-default.sh @@ -62,3 +62,10 @@ MESOS_DOCKER_WORK_DIR="${MESOS_DOCKER_WORK_DIR:-${HOME}/tmp/kubernetes}" # Arguments to pass to docker-engine running on the mesos-slave-dind containers. DOCKER_DAEMON_ARGS="${DOCKER_DAEMON_ARGS:---log-level=error}" + +# Force a dump of the logs into ${MESOS_DOCKER_WORK_DIR}/log on kube-down.sh. By +# default this only happens when kube-up.sh fails. +MESOS_DOCKER_DUMP_LOGS="${MESOS_DOCKER_DUMP_LOGS:-false}" + +# Skip rebuilding the involved docker containers on kube-up.sh. +MESOS_DOCKER_SKIP_BUILD="${MESOS_DOCKER_SKIP_BUILD:-false}" diff --git a/cluster/mesos/docker/util.sh b/cluster/mesos/docker/util.sh index 8ddd6c40bb3..838936f9ec3 100644 --- a/cluster/mesos/docker/util.sh +++ b/cluster/mesos/docker/util.sh @@ -267,7 +267,7 @@ function kube-up { echo "Pulling Docker images" 1>&2 cluster::mesos::docker::docker_compose_lazy_pull - if [ "${MESOS_DOCKER_SKIP_BUILD:-false}" != "true" ]; then + if [ "${MESOS_DOCKER_SKIP_BUILD}" != "true" ]; then echo "Building Docker images" 1>&2 # TODO: version images (k8s version, git sha, and dirty state) to avoid re-building them every time. "${provider_root}/km/build.sh" @@ -317,6 +317,9 @@ function validate-cluster { # Delete a kubernetes cluster function kube-down { + if [ "${MESOS_DOCKER_DUMP_LOGS}" == "true" ]; then + cluster::mesos::docker::dump_logs "${MESOS_DOCKER_WORK_DIR}/log" + fi echo "Stopping ${KUBERNETES_PROVIDER} cluster" 1>&2 # Since restoring a stopped cluster is not yet supported, use the nuclear option cluster::mesos::docker::docker_compose kill