diff --git a/stable/prometheus-mysql-exporter/Chart.yaml b/stable/prometheus-mysql-exporter/Chart.yaml index eee90d8fdc..f6627178d6 100644 --- a/stable/prometheus-mysql-exporter/Chart.yaml +++ b/stable/prometheus-mysql-exporter/Chart.yaml @@ -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: diff --git a/stable/prometheus-mysql-exporter/templates/deployment.yaml b/stable/prometheus-mysql-exporter/templates/deployment.yaml index 5b163b1dd7..3639220146 100644 --- a/stable/prometheus-mysql-exporter/templates/deployment.yaml +++ b/stable/prometheus-mysql-exporter/templates/deployment.yaml @@ -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: diff --git a/stable/prometheus-mysql-exporter/templates/secret-env.yaml b/stable/prometheus-mysql-exporter/templates/secret-env.yaml new file mode 100644 index 0000000000..bd3914937b --- /dev/null +++ b/stable/prometheus-mysql-exporter/templates/secret-env.yaml @@ -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 }}"