From 27388b55b99ee1c2a0c25e2df413c22354538a26 Mon Sep 17 00:00:00 2001 From: Nick Jones Date: Fri, 7 Jun 2024 13:07:45 +0100 Subject: [PATCH] [prometheus-ipmi-exporter] Optionally pull config from a Secret (#4536) Signed-off-by: Nick Jones --- charts/prometheus-ipmi-exporter/Chart.yaml | 2 +- charts/prometheus-ipmi-exporter/templates/configmap.yaml | 2 +- charts/prometheus-ipmi-exporter/templates/deployment.yaml | 8 ++++++++ charts/prometheus-ipmi-exporter/values.yaml | 5 +++++ 4 files changed, 15 insertions(+), 2 deletions(-) diff --git a/charts/prometheus-ipmi-exporter/Chart.yaml b/charts/prometheus-ipmi-exporter/Chart.yaml index 25eac5b3ce22..7bc98277f72b 100644 --- a/charts/prometheus-ipmi-exporter/Chart.yaml +++ b/charts/prometheus-ipmi-exporter/Chart.yaml @@ -4,7 +4,7 @@ description: This is an IPMI exporter for Prometheus. type: application -version: 0.3.0 +version: 0.4.0 appVersion: "v1.8.0" diff --git a/charts/prometheus-ipmi-exporter/templates/configmap.yaml b/charts/prometheus-ipmi-exporter/templates/configmap.yaml index fabf77404ca6..3e6ca588daba 100644 --- a/charts/prometheus-ipmi-exporter/templates/configmap.yaml +++ b/charts/prometheus-ipmi-exporter/templates/configmap.yaml @@ -1,4 +1,4 @@ -{{- if not .Values.configMapFile -}} +{{- if not .Values.configSecret.enabled -}} {{- $fullName := include "prometheus-ipmi-exporter.fullname" . -}} apiVersion: v1 kind: ConfigMap diff --git a/charts/prometheus-ipmi-exporter/templates/deployment.yaml b/charts/prometheus-ipmi-exporter/templates/deployment.yaml index f05f364238d5..921ea7538bba 100644 --- a/charts/prometheus-ipmi-exporter/templates/deployment.yaml +++ b/charts/prometheus-ipmi-exporter/templates/deployment.yaml @@ -56,8 +56,16 @@ spec: memory: {{ .Values.resources.requests.memory }} volumes: - name: config-volume + {{- if .Values.configSecret.enabled }} + secret: + secretName: {{ .Values.configSecret.name }} + items: + - key: {{ .Values.configSecret.key }} + path: config.yml + {{- else }} configMap: name: {{ template "prometheus-ipmi-exporter.fullname" . }} + {{- end }} {{- with .Values.extraVolumes }} {{- toYaml . | nindent 8 }} {{- end }} diff --git a/charts/prometheus-ipmi-exporter/values.yaml b/charts/prometheus-ipmi-exporter/values.yaml index ed89c6ab06c7..68c7aa97e809 100644 --- a/charts/prometheus-ipmi-exporter/values.yaml +++ b/charts/prometheus-ipmi-exporter/values.yaml @@ -63,6 +63,11 @@ serviceMonitor: # Configuration file for ipmi_exporter +configSecret: + enabled: false + name: ipmi-secret + key: config.yml + # This is an example config for scraping remote hosts via IPMI. # Information required to access remote IPMI interfaces can be supplied in the # 'modules' section. A scrape can request the usage of a given config by