From 0a74d0de5c5b406242e7e508eaf6981279efd865 Mon Sep 17 00:00:00 2001 From: festeveira Date: Thu, 21 Nov 2024 18:42:58 +0000 Subject: [PATCH 1/3] [prometheus-postgres-exporter] Implement ability to define an existing secret for the configuration file Signed-off-by: festeveira --- charts/prometheus-postgres-exporter/Chart.yaml | 2 +- .../templates/deployment.yaml | 10 ++++++++-- charts/prometheus-postgres-exporter/values.yaml | 6 ++++++ 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/charts/prometheus-postgres-exporter/Chart.yaml b/charts/prometheus-postgres-exporter/Chart.yaml index cd8d4c80c24a..00dd19d6ce99 100644 --- a/charts/prometheus-postgres-exporter/Chart.yaml +++ b/charts/prometheus-postgres-exporter/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v2 appVersion: "v0.15.0" description: A Helm chart for prometheus postgres-exporter name: prometheus-postgres-exporter -version: 6.4.0 +version: 6.5.0 home: https://github.com/prometheus-community/postgres_exporter sources: - https://github.com/prometheus-community/postgres_exporter diff --git a/charts/prometheus-postgres-exporter/templates/deployment.yaml b/charts/prometheus-postgres-exporter/templates/deployment.yaml index d7acda68696c..8c9165b5df94 100644 --- a/charts/prometheus-postgres-exporter/templates/deployment.yaml +++ b/charts/prometheus-postgres-exporter/templates/deployment.yaml @@ -159,7 +159,7 @@ spec: {{- toYaml . | nindent 12 }} {{- end }} volumeMounts: - {{- if .Values.config.postgresExporter }} + {{- if or .Values.config.postgresExporter .Values.config.existingSecret.enabled }} - name: postgres-exporter mountPath: /etc/postgres_exporter.yml subPath: postgres_exporter.yml @@ -195,7 +195,13 @@ spec: defaultMode: 420 name: {{ template "prometheus-postgres-exporter.fullname" . }} name: postgres-exporter - {{- end }} + {{- else if .Values.config.existingSecret.enabled }} + - secret: + defaultMode: 420 + secretName: {{ .Values.config.existingSecret.name }} + name: postgres-exporter + {{ end}} + {{- with .Values.extraVolumes }} {{ toYaml . | nindent 6 }} {{- end }} diff --git a/charts/prometheus-postgres-exporter/values.yaml b/charts/prometheus-postgres-exporter/values.yaml index df791aea4c75..55e2a739ee95 100644 --- a/charts/prometheus-postgres-exporter/values.yaml +++ b/charts/prometheus-postgres-exporter/values.yaml @@ -188,6 +188,12 @@ config: # password: firstpass # options: # sslmode: disable + + # define an existing secret to be mounted as the config file + # needs to have the key 'postgres_exporter.yml' + existingSecret: + enabled: false + name: "" nodeSelector: {} From a49338f9a8df55f6011666713af2afec6f78885d Mon Sep 17 00:00:00 2001 From: festeveira Date: Fri, 22 Nov 2024 23:01:52 +0000 Subject: [PATCH 2/3] Remove trailing whitespaces Signed-off-by: festeveira --- charts/prometheus-postgres-exporter/values.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/prometheus-postgres-exporter/values.yaml b/charts/prometheus-postgres-exporter/values.yaml index 55e2a739ee95..080746511d44 100644 --- a/charts/prometheus-postgres-exporter/values.yaml +++ b/charts/prometheus-postgres-exporter/values.yaml @@ -188,7 +188,7 @@ config: # password: firstpass # options: # sslmode: disable - + # define an existing secret to be mounted as the config file # needs to have the key 'postgres_exporter.yml' existingSecret: From 026a6df4b5c30a99a81ffaa5b8f556d1321a558e Mon Sep 17 00:00:00 2001 From: zeritti <47476160+zeritti@users.noreply.github.com> Date: Wed, 27 Nov 2024 14:29:22 +0100 Subject: [PATCH 3/3] Update Chart.yaml Signed-off-by: zeritti <47476160+zeritti@users.noreply.github.com> --- charts/prometheus-postgres-exporter/Chart.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/prometheus-postgres-exporter/Chart.yaml b/charts/prometheus-postgres-exporter/Chart.yaml index eb653698ea57..84e8c3be94d8 100644 --- a/charts/prometheus-postgres-exporter/Chart.yaml +++ b/charts/prometheus-postgres-exporter/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v2 appVersion: "v0.16.0" description: A Helm chart for prometheus postgres-exporter name: prometheus-postgres-exporter -version: 6.5.0 +version: 6.6.0 home: https://github.com/prometheus-community/postgres_exporter sources: - https://github.com/prometheus-community/postgres_exporter