From 178d167bcafdf54a9d227fe60d56ae8eab24940e Mon Sep 17 00:00:00 2001 From: Don Petersen Date: Mon, 16 Apr 2018 14:19:57 -0700 Subject: [PATCH] Annotations and checksum (#5067) * Allow overriding service annotations. Service annotations are a common way to allow metric discovery in Prometheus, including the stable Prometheus chart, so it makes sense to allow a user of this chart to override those values. * Invalidate deployment on ConfigMap change. Once a cloudwatch exporter is set up, most of the tweaking you'll be doing will be to the configuration. This technique is described in the Helm Chart Tips & Tricks documentation: https://github.com/kubernetes/helm/blob/master/docs/charts_tips_and_tricks.md#automatically-roll-deployments-when-configmaps-or-secrets-change * Raise chart version. --- stable/prometheus-cloudwatch-exporter/Chart.yaml | 2 +- stable/prometheus-cloudwatch-exporter/README.md | 1 + stable/prometheus-cloudwatch-exporter/templates/deployment.yaml | 1 + stable/prometheus-cloudwatch-exporter/templates/service.yaml | 2 ++ stable/prometheus-cloudwatch-exporter/values.yaml | 1 + 5 files changed, 6 insertions(+), 1 deletion(-) diff --git a/stable/prometheus-cloudwatch-exporter/Chart.yaml b/stable/prometheus-cloudwatch-exporter/Chart.yaml index 50161261b0..4d0a9ec120 100644 --- a/stable/prometheus-cloudwatch-exporter/Chart.yaml +++ b/stable/prometheus-cloudwatch-exporter/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v1 appVersion: "0.1.0" description: A Helm chart for prometheus cloudwatch-exporter name: prometheus-cloudwatch-exporter -version: 0.1.1 +version: 0.1.2 home: https://github.com/prometheus/cloudwatch_exporter sources: - https://github.com/prometheus/cloudwatch_exporter diff --git a/stable/prometheus-cloudwatch-exporter/README.md b/stable/prometheus-cloudwatch-exporter/README.md index 4a50ed3638..6646c5c400 100644 --- a/stable/prometheus-cloudwatch-exporter/README.md +++ b/stable/prometheus-cloudwatch-exporter/README.md @@ -51,6 +51,7 @@ The following table lists the configurable parameters of the Cloudwatch Exporter | `service.type` | Service type | `ClusterIP` | | `service.port` | The service port | `80` | | `service.targetPort` | The target port of the container | `9100` | +| `service.annotations` | Custom annotations for service | `{}` | | `resources` | | `{}` | | `aws.region` | AWS Cloudwatch region | `eu-west-1` | | `aws.role` | AWS IAM Role To Use | | diff --git a/stable/prometheus-cloudwatch-exporter/templates/deployment.yaml b/stable/prometheus-cloudwatch-exporter/templates/deployment.yaml index 2788da71e3..9c5dff7104 100644 --- a/stable/prometheus-cloudwatch-exporter/templates/deployment.yaml +++ b/stable/prometheus-cloudwatch-exporter/templates/deployment.yaml @@ -20,6 +20,7 @@ spec: release: {{ .Release.Name }} annotations: {{ if .Values.aws.role}}iam.amazonaws.com/role: {{ .Values.aws.role }}{{ end }} + checksum/config: {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }} spec: containers: - name: {{ .Chart.Name }} diff --git a/stable/prometheus-cloudwatch-exporter/templates/service.yaml b/stable/prometheus-cloudwatch-exporter/templates/service.yaml index 01807eb048..418223fe3b 100644 --- a/stable/prometheus-cloudwatch-exporter/templates/service.yaml +++ b/stable/prometheus-cloudwatch-exporter/templates/service.yaml @@ -2,6 +2,8 @@ apiVersion: v1 kind: Service metadata: name: {{ template "prometheus-cloudwatch-exporter.fullname" . }} + annotations: +{{ toYaml .Values.service.annotations | indent 4 }} labels: app: {{ template "prometheus-cloudwatch-exporter.name" . }} chart: {{ template "prometheus-cloudwatch-exporter.chart" . }} diff --git a/stable/prometheus-cloudwatch-exporter/values.yaml b/stable/prometheus-cloudwatch-exporter/values.yaml index 2c4a90ce97..68dda8c242 100644 --- a/stable/prometheus-cloudwatch-exporter/values.yaml +++ b/stable/prometheus-cloudwatch-exporter/values.yaml @@ -13,6 +13,7 @@ service: type: ClusterIP port: 80 targetPort: 9100 + annotations: {} resources: {} # We usually recommend not to specify default resources and to leave this as a conscious