Skip to content

Commit 8c9e2e7

Browse files
festeveirazanhsiehzeritti
authored
[prometheus-postgres-exporter] Implement ability to define an existing secret (#5011)
* [prometheus-postgres-exporter] Implement ability to define an existing secret for the configuration file Signed-off-by: festeveira <[email protected]> * Remove trailing whitespaces Signed-off-by: festeveira <[email protected]> * Update Chart.yaml Signed-off-by: zeritti <[email protected]> --------- Signed-off-by: festeveira <[email protected]> Signed-off-by: MH <[email protected]> Signed-off-by: zeritti <[email protected]> Co-authored-by: MH <[email protected]> Co-authored-by: zeritti <[email protected]>
1 parent 1a9a385 commit 8c9e2e7

File tree

3 files changed

+15
-3
lines changed

3 files changed

+15
-3
lines changed

charts/prometheus-postgres-exporter/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ apiVersion: v2
22
appVersion: "v0.16.0"
33
description: A Helm chart for prometheus postgres-exporter
44
name: prometheus-postgres-exporter
5-
version: 6.5.0
5+
version: 6.6.0
66
home: https://github.com/prometheus-community/postgres_exporter
77
sources:
88
- https://github.com/prometheus-community/postgres_exporter

charts/prometheus-postgres-exporter/templates/deployment.yaml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ spec:
159159
{{- toYaml . | nindent 12 }}
160160
{{- end }}
161161
volumeMounts:
162-
{{- if .Values.config.postgresExporter }}
162+
{{- if or .Values.config.postgresExporter .Values.config.existingSecret.enabled }}
163163
- name: postgres-exporter
164164
mountPath: /etc/postgres_exporter.yml
165165
subPath: postgres_exporter.yml
@@ -195,7 +195,13 @@ spec:
195195
defaultMode: 420
196196
name: {{ template "prometheus-postgres-exporter.fullname" . }}
197197
name: postgres-exporter
198-
{{- end }}
198+
{{- else if .Values.config.existingSecret.enabled }}
199+
- secret:
200+
defaultMode: 420
201+
secretName: {{ .Values.config.existingSecret.name }}
202+
name: postgres-exporter
203+
{{ end}}
204+
199205
{{- with .Values.extraVolumes }}
200206
{{ toYaml . | nindent 6 }}
201207
{{- end }}

charts/prometheus-postgres-exporter/values.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,12 @@ config:
189189
# options:
190190
# sslmode: disable
191191

192+
# define an existing secret to be mounted as the config file
193+
# needs to have the key 'postgres_exporter.yml'
194+
existingSecret:
195+
enabled: false
196+
name: ""
197+
192198
nodeSelector: {}
193199

194200
tolerations: []

0 commit comments

Comments
 (0)