From d837f16045c07148edafefe880f10027a979758f Mon Sep 17 00:00:00 2001 From: Satnam Singh Date: Tue, 11 Nov 2014 14:44:59 -0800 Subject: [PATCH] Turn on Elasticsearch logging by default for GCE platform --- cluster/gce/config-default.sh | 7 +++++++ cluster/gce/util.sh | 8 ++++++++ 2 files changed, 15 insertions(+) diff --git a/cluster/gce/config-default.sh b/cluster/gce/config-default.sh index 2b98bc6fd8d..15a581ea643 100755 --- a/cluster/gce/config-default.sh +++ b/cluster/gce/config-default.sh @@ -37,3 +37,10 @@ POLL_SLEEP_INTERVAL=3 PORTAL_NET="10.0.0.0/16" # When set to true, heapster will be setup as part of the cluster bring up. MONITORING=true +# Turn on Elasticsearch logging unless Google Cloud Logging has been selected or +# if Elasticsearch logging has been specifically turned off. +if [[ "${FLUENTD_GCP-}" != "true" ]]; then + if [[ "${FLUENTD_ELASTICSEARCH-}" != "false" ]]; then + FLUENTD_ELASTICSEARCH="true" + fi +fi diff --git a/cluster/gce/util.sh b/cluster/gce/util.sh index a3e4bebb909..3775acc6f86 100755 --- a/cluster/gce/util.sh +++ b/cluster/gce/util.sh @@ -299,6 +299,14 @@ function kube-up { grep -v "^#" "${KUBE_ROOT}/cluster/gce/templates/salt-master.sh" ) > "${KUBE_TEMP}/master-start.sh" + # Report logging choice (if any). + if [[ "${FLUENTD_ELASTICSEARCH-}" == "true" ]]; then + echo "+++ Logging using Fluentd to Elasticsearch" + fi + if [[ "${FLUENTD_GCP-}" == "true" ]]; then + echo "+++ Logging using Fluentd to Google Cloud Logging" + fi + # For logging to GCP we need to enable some minion scopes. if [[ "${FLUENTD_GCP-}" == "true" ]]; then MINION_SCOPES="${MINION_SCOPES}, https://www.googleapis.com/auth/logging.write"