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.
This commit is contained in:
Don Petersen
2018-04-16 14:19:57 -07:00
committed by k8s-ci-robot
parent d4c6cc3844
commit 178d167bca
5 changed files with 6 additions and 1 deletions
@@ -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
@@ -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 | |
@@ -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 }}
@@ -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" . }}
@@ -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