Skip to content

Commit

Permalink
[prometheus-redis-exporter] Allow REDIS_ADDR environment variable t…
Browse files Browse the repository at this point in the history
…o be configured through a secret (#3775)

* Allow `REDIS_ADDR` env var to be configured through a secret additionally to the configmap

Signed-off-by: David Constenla <[email protected]>

* Be explicit about the change breaking the values signature

And adjust variable names

Co-authored-by: zeritti <[email protected]>
Signed-off-by: David Constenla <[email protected]>

* Update the comment so it represents the current configuration

Signed-off-by: David Constenla <[email protected]>

---------

Signed-off-by: David Constenla <[email protected]>
Signed-off-by: David Constenla <[email protected]>
Co-authored-by: zeritti <[email protected]>
  • Loading branch information
daconstenla and zeritti authored Sep 26, 2023
1 parent 6bf9e9c commit 5868e00
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
2 changes: 1 addition & 1 deletion charts/prometheus-redis-exporter/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v2
appVersion: v1.54.0
description: Prometheus exporter for Redis metrics
name: prometheus-redis-exporter
version: 5.6.0
version: 6.0.0
home: https://github.com/oliver006/redis_exporter
sources:
- https://github.com/oliver006/redis_exporter
Expand Down
8 changes: 6 additions & 2 deletions charts/prometheus-redis-exporter/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,13 @@ spec:
- name: REDIS_ADDR
{{- if .Values.redisAddressConfig.enabled }}
valueFrom:
{{- if .Values.redisAddressConfig.isSecret }}
secretKeyRef:
{{- else }}
configMapKeyRef:
name: {{ .Values.redisAddressConfig.configmap.name }}
key: {{ .Values.redisAddressConfig.configmap.key }}
{{- end }}
name: {{ .Values.redisAddressConfig.source.name }}
key: {{ .Values.redisAddressConfig.source.key }}
{{- else }}
value: {{ .Values.redisAddress }}
{{- end }}
Expand Down
8 changes: 5 additions & 3 deletions charts/prometheus-redis-exporter/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,12 @@ labels: {}
# prometheus.io/scrape: "true"

redisAddressConfig:
# Use config from configmap
# configure `REDIS_ADDR` from a configmap
enabled: false
# Use existing configmap (ignores redisAddress)
configmap:
# if `true` the `REDIS_ADDR` is sourced on a secret instead of a configmap
isSecret: false
# Use an existing configmap or secret will ignore redisAddress
source:
name: ""
key: ""

Expand Down

0 comments on commit 5868e00

Please sign in to comment.