fix: pass REDIS_PASSWORD to metrics exporter when auth is enabled#141
Open
jessebye wants to merge 1 commit intovalkey-io:mainfrom
Open
fix: pass REDIS_PASSWORD to metrics exporter when auth is enabled#141jessebye wants to merge 1 commit intovalkey-io:mainfrom
jessebye wants to merge 1 commit intovalkey-io:mainfrom
Conversation
Signed-off-by: jessebye <8467862+jessebye@users.noreply.github.com>
gaelgoth
reviewed
Feb 16, 2026
Comment on lines
193
to
+209
| env: | ||
| - name: REDIS_ALIAS | ||
| value: {{ include "valkey.fullname" . }} | ||
| {{- if .Values.auth.enabled }} | ||
| - name: REDIS_PASSWORD | ||
| valueFrom: | ||
| secretKeyRef: | ||
| {{- if .Values.auth.usersExistingSecret }} | ||
| {{- $defaultUser := index .Values.auth.aclUsers "default" | default dict }} | ||
| {{- $passwordKey := $defaultUser.passwordKey | default "default" }} | ||
| name: {{ .Values.auth.usersExistingSecret }} | ||
| key: {{ $passwordKey }} | ||
| {{- else }} | ||
| name: {{ include "valkey.fullname" . }}-auth | ||
| key: default-password | ||
| {{- end }} | ||
| {{- end }} |
There was a problem hiding this comment.
Hi @jessebye 👋
I’m planning to use a dedicated redis user for the exporter, as described in the docs:
https://github.com/oliver006/redis_exporter/blob/master/README.md?plain=1#L260
Would it be possible to make this more flexible and allow configuring a different user if needed? For example:
Suggested change
| env: | |
| - name: REDIS_ALIAS | |
| value: {{ include "valkey.fullname" . }} | |
| {{- if .Values.auth.enabled }} | |
| - name: REDIS_PASSWORD | |
| valueFrom: | |
| secretKeyRef: | |
| {{- if .Values.auth.usersExistingSecret }} | |
| {{- $defaultUser := index .Values.auth.aclUsers "default" | default dict }} | |
| {{- $passwordKey := $defaultUser.passwordKey | default "default" }} | |
| name: {{ .Values.auth.usersExistingSecret }} | |
| key: {{ $passwordKey }} | |
| {{- else }} | |
| name: {{ include "valkey.fullname" . }}-auth | |
| key: default-password | |
| {{- end }} | |
| {{- end }} | |
| env: | |
| - name: REDIS_ALIAS | |
| value: {{ include "valkey.fullname" . }} | |
| {{- if .Values.auth.enabled }} | |
| - name: REDIS_USER | |
| value: {{ .Values.metrics.exporter.user | default "default" }} | |
| - name: REDIS_PASSWORD | |
| valueFrom: | |
| secretKeyRef: | |
| {{- if .Values.auth.usersExistingSecret }} | |
| {{- $metricsUser := .Values.metrics.exporter.user | default "default" }} | |
| {{- $userConfig := index .Values.auth.aclUsers $metricsUser | default dict }} | |
| {{- $passwordKey := $userConfig.passwordKey | default $metricsUser }} | |
| name: {{ .Values.auth.usersExistingSecret }} | |
| key: {{ $passwordKey }} | |
| {{- else }} | |
| name: {{ include "valkey.fullname" . }}-auth | |
| key: default-password | |
| {{- end }} | |
| {{- end }} |
Then it can allow dedicated redis user:
auth:
enabled: true
usersExistingSecret: test-valkey-auth
aclUsers:
default:
permissions: "~* &* +@all"
passwordKey: default
monitor:
permissions: >- # Limited permissions for monitoring: https://github.com/oliver006/redis_exporter/blob/master/README.md?plain=1#L260
~* &* -@all +@connection +memory -readonly +strlen +config|get +xinfo
+pfcount -quit +zcard +type +xlen -readwrite -command +client -wait
+scard +llen +hlen +get +eval +slowlog +cluster|info +cluster|slots
+cluster|nodes -hello -echo +info +latency +scan -reset -auth -asking
passwordKey: monitor
Author
There was a problem hiding this comment.
@gaelgoth that seems reasonable, but does go outside the scope of this PR a bit. perhaps this could be added first, then a separate PR that adds support for using a different user in the metrics exporter?
There was a problem hiding this comment.
I’m fine shipping this part first, and then adding support for extra users in metrics exporter 👍🏾
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Passes the
REDIS_PASSWORDenv to the metrics exporter container when auth is enabled. This resolves #135