Skip to content

Commit

Permalink
[prometheus-ipmi-exporter] Optionally pull config from a Secret (#4536)
Browse files Browse the repository at this point in the history
Signed-off-by: Nick Jones <[email protected]>
  • Loading branch information
yankcrime authored Jun 7, 2024
1 parent 0194d59 commit 27388b5
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 2 deletions.
2 changes: 1 addition & 1 deletion charts/prometheus-ipmi-exporter/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
2 changes: 1 addition & 1 deletion charts/prometheus-ipmi-exporter/templates/configmap.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{- if not .Values.configMapFile -}}
{{- if not .Values.configSecret.enabled -}}
{{- $fullName := include "prometheus-ipmi-exporter.fullname" . -}}
apiVersion: v1
kind: ConfigMap
Expand Down
8 changes: 8 additions & 0 deletions charts/prometheus-ipmi-exporter/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
5 changes: 5 additions & 0 deletions charts/prometheus-ipmi-exporter/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 27388b5

Please sign in to comment.