From bc53533c833bf07c0d247ab410eedca055417954 Mon Sep 17 00:00:00 2001 From: saadali Date: Thu, 4 Jun 2015 23:27:33 -0700 Subject: [PATCH 1/2] Enable InfluxDB/Grafana for GCE in addition to GCM/GCL --- .../heapster-controller-combined.yaml | 48 +++++++++++++++++++ cluster/gce/config-default.sh | 9 ++-- cluster/saltbase/salt/kube-addons/init.sls | 12 +++++ 3 files changed, 65 insertions(+), 4 deletions(-) create mode 100644 cluster/addons/cluster-monitoring/googleinfluxdb/heapster-controller-combined.yaml diff --git a/cluster/addons/cluster-monitoring/googleinfluxdb/heapster-controller-combined.yaml b/cluster/addons/cluster-monitoring/googleinfluxdb/heapster-controller-combined.yaml new file mode 100644 index 00000000000..c416f8c3023 --- /dev/null +++ b/cluster/addons/cluster-monitoring/googleinfluxdb/heapster-controller-combined.yaml @@ -0,0 +1,48 @@ +apiVersion: v1beta3 +kind: ReplicationController +metadata: + name: monitoring-heapster-v1 + namespace: default + labels: + k8s-app: heapster + version: v1 + kubernetes.io/cluster-service: "true" +spec: + replicas: 1 + selector: + k8s-app: heapster + version: v1 + template: + metadata: + labels: + k8s-app: heapster + version: v1 + kubernetes.io/cluster-service: "true" + spec: + containers: + - image: gcr.io/google_containers/heapster:v0.13.0 + name: heapster + command: + - /heapster + - --source=kubernetes:https://kubernetes + - --sink=gcm + - --sink=gcl + - --sink=influxdb:http://monitoring-influxdb:8086 + - --poll_duration=2m + - --stats_resolution=1m + volumeMounts: + - name: ssl-certs + mountPath: /etc/ssl/certs + readOnly: true + - name: monitoring-token + mountPath: /etc/kubernetes/kubeconfig + readOnly: true + + volumes: + - name: ssl-certs + hostPath: + path: /etc/ssl/certs + - name: monitoring-token + secret: + secretName: token-system-monitoring + diff --git a/cluster/gce/config-default.sh b/cluster/gce/config-default.sh index 949aa3f5fb7..4ec7167ce30 100755 --- a/cluster/gce/config-default.sh +++ b/cluster/gce/config-default.sh @@ -54,10 +54,11 @@ ENABLE_DOCKER_REGISTRY_CACHE=true ENABLE_NODE_MONITORING="${KUBE_ENABLE_NODE_MONITORING:-true}" # Optional: Cluster monitoring to setup as part of the cluster bring up: -# none - No cluster monitoring setup -# influxdb - Heapster, InfluxDB, and Grafana -# google - Heapster, Google Cloud Monitoring, and Google Cloud Logging -ENABLE_CLUSTER_MONITORING="${KUBE_ENABLE_CLUSTER_MONITORING:-google}" +# none - No cluster monitoring setup +# influxdb - Heapster, InfluxDB, and Grafana +# google - Heapster, Google Cloud Monitoring, and Google Cloud Logging +# googleinfluxdb - Enable influxdb and google +ENABLE_CLUSTER_MONITORING="${KUBE_ENABLE_CLUSTER_MONITORING:-googleinfluxdb}" # Optional: Enable node logging. ENABLE_NODE_LOGGING="${KUBE_ENABLE_NODE_LOGGING:-true}" diff --git a/cluster/saltbase/salt/kube-addons/init.sls b/cluster/saltbase/salt/kube-addons/init.sls index a129666b430..0d6b1c72622 100644 --- a/cluster/saltbase/salt/kube-addons/init.sls +++ b/cluster/saltbase/salt/kube-addons/init.sls @@ -20,6 +20,18 @@ - file_mode: 644 {% endif %} +{% if pillar.get('enable_cluster_monitoring', '').lower() == 'googleinfluxdb' %} +/etc/kubernetes/addons/cluster-monitoring/googleinfluxdb: + file.recurse: + - source: salt://kube-addons/cluster-monitoring + - include_pat: E@(^.+\.yaml$|^.+\.json$) + - exclude_pat: E@(^.+heapster-controller\.yaml$|^.+heapster-controller\.json$) + - user: root + - group: root + - dir_mode: 755 + - file_mode: 644 +{% endif %} + {% if pillar.get('enable_cluster_dns', '').lower() == 'true' %} /etc/kubernetes/addons/dns/skydns-svc.yaml: file.managed: From a839f47d4a782669d20561a52144eade835a38e5 Mon Sep 17 00:00:00 2001 From: saadali Date: Fri, 5 Jun 2015 17:54:06 -0700 Subject: [PATCH 2/2] Disable GCM for GCE --- .../googleinfluxdb/heapster-controller-combined.yaml | 1 - cluster/gce/config-default.sh | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/cluster/addons/cluster-monitoring/googleinfluxdb/heapster-controller-combined.yaml b/cluster/addons/cluster-monitoring/googleinfluxdb/heapster-controller-combined.yaml index c416f8c3023..ca1e3acf0bb 100644 --- a/cluster/addons/cluster-monitoring/googleinfluxdb/heapster-controller-combined.yaml +++ b/cluster/addons/cluster-monitoring/googleinfluxdb/heapster-controller-combined.yaml @@ -25,7 +25,6 @@ spec: command: - /heapster - --source=kubernetes:https://kubernetes - - --sink=gcm - --sink=gcl - --sink=influxdb:http://monitoring-influxdb:8086 - --poll_duration=2m diff --git a/cluster/gce/config-default.sh b/cluster/gce/config-default.sh index 4ec7167ce30..a4b4459db21 100755 --- a/cluster/gce/config-default.sh +++ b/cluster/gce/config-default.sh @@ -57,7 +57,7 @@ ENABLE_NODE_MONITORING="${KUBE_ENABLE_NODE_MONITORING:-true}" # none - No cluster monitoring setup # influxdb - Heapster, InfluxDB, and Grafana # google - Heapster, Google Cloud Monitoring, and Google Cloud Logging -# googleinfluxdb - Enable influxdb and google +# googleinfluxdb - Enable influxdb and google (except GCM) ENABLE_CLUSTER_MONITORING="${KUBE_ENABLE_CLUSTER_MONITORING:-googleinfluxdb}" # Optional: Enable node logging.