From 4f1f180e8ecc3b588aeb563c78250931434e9b5a Mon Sep 17 00:00:00 2001 From: Steve Wilkerson Date: Mon, 19 Feb 2018 16:15:02 -0600 Subject: [PATCH] Add prometheus annotations to tiller-deploy service This adds the prometheus annotations to the tiller chart, allowing for the scraping of metrics from tiller. currently, tiller exports metrics specific to the grpc calls being made against it Change-Id: Ibe10098689cc37a9de6306af86f4d63d8aab318b --- tiller/templates/deployment-tiller.yaml | 3 +++ tiller/templates/service-tiller-deploy.yaml | 9 +++++++++ tiller/values.yaml | 7 +++++++ tools/gate/playbooks/gather-prom-metrics/tasks/main.yaml | 7 +++++++ 4 files changed, 26 insertions(+) diff --git a/tiller/templates/deployment-tiller.yaml b/tiller/templates/deployment-tiller.yaml index 0a0368f9..070ebde1 100644 --- a/tiller/templates/deployment-tiller.yaml +++ b/tiller/templates/deployment-tiller.yaml @@ -74,6 +74,9 @@ spec: - containerPort: 44134 name: tiller protocol: TCP + - containerPort: 44135 + name: metrics + protocol: TCP readinessProbe: failureThreshold: 3 httpGet: diff --git a/tiller/templates/service-tiller-deploy.yaml b/tiller/templates/service-tiller-deploy.yaml index 86ccf28d..34b116e8 100644 --- a/tiller/templates/service-tiller-deploy.yaml +++ b/tiller/templates/service-tiller-deploy.yaml @@ -16,6 +16,7 @@ limitations under the License. {{- if .Values.manifests.service_tiller_deploy }} {{- $envAll := . }} +{{- $prometheus_annotations := $envAll.Values.monitoring.prometheus.tiller }} --- apiVersion: v1 kind: Service @@ -24,12 +25,20 @@ metadata: app: helm name: tiller name: tiller-deploy + annotations: +{{- if .Values.monitoring.prometheus.enabled }} +{{ tuple $prometheus_annotations | include "helm-toolkit.snippets.prometheus_service_annotations" | indent 4 }} +{{- end }} spec: ports: - name: tiller port: 44134 protocol: TCP targetPort: tiller + - name: metrics + port: 44135 + protocol: TCP + targetPort: metrics selector: app: helm name: tiller diff --git a/tiller/values.yaml b/tiller/values.yaml index 33038d87..ab888b85 100644 --- a/tiller/values.yaml +++ b/tiller/values.yaml @@ -78,6 +78,13 @@ endpoints: registry: node: 5000 +monitoring: + prometheus: + enabled: true + tiller: + scrape: true + port: 44135 + manifests: clusterrolebinding_tiller: true configmap_bin: true diff --git a/tools/gate/playbooks/gather-prom-metrics/tasks/main.yaml b/tools/gate/playbooks/gather-prom-metrics/tasks/main.yaml index 0336a57b..c05e4eb3 100644 --- a/tools/gate/playbooks/gather-prom-metrics/tasks/main.yaml +++ b/tools/gate/playbooks/gather-prom-metrics/tasks/main.yaml @@ -29,6 +29,13 @@ args: executable: /bin/bash +- name: "Get prometheus metrics from tiller-deploy" + shell: |- + set -e + curl tiller-deploy.kube-system:44135/metrics >> "{{ logs_dir }}"/prometheus/kube-system-tiller-deploy.txt + args: + executable: /bin/bash + - name: "Downloads logs to executor" synchronize: src: "{{ logs_dir }}/prometheus"