Skip to content

Commit

Permalink
[prometheus-pingdom-exporter] Add secret override for pingdom exporter (
Browse files Browse the repository at this point in the history
prometheus-community#741)

* add ability to specify existing secret for pingdom exporter

Signed-off-by: David Ashford <[email protected]>

* udpate secretRef to include existing secret name

Signed-off-by: David Ashford <[email protected]>

* remove testing values

Signed-off-by: David Ashford <[email protected]>

* set correct chart version

Signed-off-by: David Ashford <[email protected]>
  • Loading branch information
dashford authored Apr 11, 2021
1 parent 6e7af4b commit 30732e3
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 6 deletions.
2 changes: 1 addition & 1 deletion charts/prometheus-pingdom-exporter/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
apiVersion: v1
name: prometheus-pingdom-exporter
version: 2.3.2
version: 2.4.0
appVersion: 20190610-1
home: https://github.com/giantswarm/prometheus-pingdom-exporter
description: A Helm chart for Prometheus Pingdom Exporter
Expand Down
11 changes: 11 additions & 0 deletions charts/prometheus-pingdom-exporter/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -60,3 +60,14 @@ Create the name of the service account to use
{{- default "default" .Values.serviceAccount.name }}
{{- end }}
{{- end }}

{{/*
Determine secret name, can either be the self-created of an existing one
*/}}
{{- define "prometheus-pingdom-exporter.secretName" -}}
{{- if .Values.existingSecret.name -}}
{{- .Values.existingSecret.name -}}
{{- else -}}
{{ include "prometheus-pingdom-exporter.fullname" . }}
{{- end -}}
{{- end -}}
8 changes: 4 additions & 4 deletions charts/prometheus-pingdom-exporter/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,22 +34,22 @@ spec:
- name: PINGDOM_USER
valueFrom:
secretKeyRef:
name: {{ include "prometheus-pingdom-exporter.name" . }}
name: {{ include "prometheus-pingdom-exporter.secretName" . }}
key: user
- name: PINGDOM_PASSWORD
valueFrom:
secretKeyRef:
name: {{ include "prometheus-pingdom-exporter.name" . }}
name: {{ include "prometheus-pingdom-exporter.secretName" . }}
key: password
- name: PINGDOM_APPID
valueFrom:
secretKeyRef:
name: {{ include "prometheus-pingdom-exporter.name" . }}
name: {{ include "prometheus-pingdom-exporter.secretName" . }}
key: appId
- name: PINGDOM_ACCOUNT
valueFrom:
secretKeyRef:
name: {{ include "prometheus-pingdom-exporter.name" . }}
name: {{ include "prometheus-pingdom-exporter.secretName" . }}
key: accountEmail
ports:
- name: http
Expand Down
4 changes: 3 additions & 1 deletion charts/prometheus-pingdom-exporter/templates/secret.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
{{- if not .Values.existingSecret.name -}}
apiVersion: v1
kind: Secret
metadata:
name: {{ include "prometheus-pingdom-exporter.name" . }}
name: {{ include "prometheus-pingdom-exporter.secretName" . }}
{{- if .Values.secret.annotations }}
annotations:
{{- toYaml .Values.secret.annotations | nindent 4 }}
Expand All @@ -14,3 +15,4 @@ data:
password: {{ .Values.pingdom.password | b64enc }}
appId: {{ .Values.pingdom.appId | b64enc }}
accountEmail: {{ .Values.pingdom.accountEmail | b64enc }}
{{- end }}
3 changes: 3 additions & 0 deletions charts/prometheus-pingdom-exporter/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,9 @@ pod:
# key: "true"
# example: "false"

existingSecret:
name: ""

secret:
annotations: {}
# key: "true"
Expand Down

0 comments on commit 30732e3

Please sign in to comment.