Skip to content

fix: support secretKeyRef in metrics exporter extraEnvs#167

Open
kkonaparthi1 wants to merge 1 commit into
valkey-io:mainfrom
kkonaparthi1:fix-extraenvs-valuefrom
Open

fix: support secretKeyRef in metrics exporter extraEnvs#167
kkonaparthi1 wants to merge 1 commit into
valkey-io:mainfrom
kkonaparthi1:fix-extraenvs-valuefrom

Conversation

@kkonaparthi1
Copy link
Copy Markdown

Fixes #151

Summary

Update the extraEnvs template to support Kubernetes secret references (secretKeyRef) in addition to plain string values.

Changes

  • statefulset.yaml — check value type with kindIs "string", render value: for strings or valueFrom: for objects
  • deploy_valkey.yaml — same fix
  • values.yaml — updated example comments showing both plain and secret reference usage

Backwards Compatible

Existing plain string extraEnvs values continue to work unchanged. Only map/object values are now rendered as valueFrom: blocks.

Example

metrics:
  exporter:
    extraEnvs:
      LOG_LEVEL: info  # plain string — works as before
      REDIS_PASSWORD:  # secret reference — now supported
        secretKeyRef:
          name: valkey-secret
          key: password

Update the extraEnvs template in statefulset.yaml and deploy_valkey.yaml
to check the value type using kindIs. Plain string values continue to
render as value: while map/object values render as valueFrom: blocks.

This enables passing credentials securely via Kubernetes secrets
(e.g. secretKeyRef) to the metrics exporter sidecar, which was
previously impossible because the template hardcoded value: for all
entries.

Backwards compatible — existing plain string extraEnvs continue to
work unchanged.

Fixes valkey-io#151

Signed-off-by: Karthik Konaparthi <konapk@amazon.com>
@sgissi
Copy link
Copy Markdown
Collaborator

sgissi commented May 2, 2026

Hi @kkonaparthi1, the REDIS_PASSWORD use case was fixed on #141 and released on chart 0.94. Is there any additional use case for this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

metrics.exporter.extraEnvs does not support Kubernetes secret references

2 participants