mirror of
https://github.com/helm/charts.git
synced 2026-08-23 22:37:45 +00:00
feat(stable/prometheus-mysql-exporter): store MySQL password in a k8s Secret (#14712)
The DATA_SOURCE_NAME environment variable contains a secret key for authenticating to th MySQL instance (.Values.mysql.pass). This secret should be stored in a K8s Secret object rather than directly on the Deployment. Kubernetes RBAC requires more elevated permissions for viewing Secret data than for viewing Deployment configuration. Signed-off-by: Thomas Lovett <tklovett@gmail.com>
This commit is contained in:
committed by
Kubernetes Prow Robot
parent
5be1dd36fb
commit
ee98b028d7
@@ -1,7 +1,7 @@
|
||||
apiVersion: v1
|
||||
description: A Helm chart for prometheus mysql exporter with cloudsqlproxy
|
||||
name: prometheus-mysql-exporter
|
||||
version: 0.3.4
|
||||
version: 0.4.0
|
||||
home: https://github.com/prometheus/mysqld_exporter
|
||||
appVersion: v0.11.0
|
||||
sources:
|
||||
|
||||
@@ -48,9 +48,9 @@ spec:
|
||||
{{- end }}
|
||||
]
|
||||
{{- end }}
|
||||
env:
|
||||
- name: DATA_SOURCE_NAME
|
||||
value: "{{ .Values.mysql.user }}:{{ .Values.mysql.pass }}@{{ if .Values.mysql.protocol }}{{ .Values.mysql.protocol }}{{ end }}({{ .Values.mysql.host }}:{{ .Values.mysql.port }})/{{ if .Values.mysql.db }}{{ .Values.mysql.db }}{{ end }}{{ if .Values.mysql.param }}?{{ .Values.mysql.param }}{{ end }}"
|
||||
envFrom:
|
||||
- secretRef:
|
||||
name: {{ template "prometheus-mysql-exporter.fullname" . }}
|
||||
ports:
|
||||
- containerPort: {{ .Values.service.internalPort }}
|
||||
livenessProbe:
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
apiVersion: v1
|
||||
kind: Secret
|
||||
metadata:
|
||||
name: {{ template "prometheus-mysql-exporter.fullname" . }}
|
||||
type: Opaque
|
||||
stringData:
|
||||
DATA_SOURCE_NAME: "{{ .Values.mysql.user }}:{{ .Values.mysql.pass }}@{{ if .Values.mysql.protocol }}{{ .Values.mysql.protocol }}{{ end }}({{ .Values.mysql.host }}:{{ .Values.mysql.port }})/{{ if .Values.mysql.db }}{{ .Values.mysql.db }}{{ end }}{{ if .Values.mysql.param }}?{{ .Values.mysql.param }}{{ end }}"
|
||||
Reference in New Issue
Block a user