metrics.exporter.extraEnvs only supports plain string values due to how the template renders them:
{{- range $key, $val := .Values.metrics.exporter.extraEnvs }}
- name: {{ $key }}
value: "{{ $val }}"
{{- end }}
This makes it impossible to reference Kubernetes secrets (e.g. secretKeyRef) for sensitive values like passwords, which is a common requirement when running Valkey with authentication enabled and wanting to scrape metrics via redis_exporter.
Fix: update the template in statefulset.yaml and deploy_valkey.yaml to check the value type:
{{- range $key, $val := .Values.metrics.exporter.extraEnvs }}
- name: {{ $key }}
{{- if kindIs "string" $val }}
value: "{{ $val }}"
{{- else }}
valueFrom:
{{- toYaml $val | nindent 4 }}
{{- end }}
{{- end }}
This is backwards compatible, plain string values continue to work, while map values are treated as valueFrom blocks.
metrics.exporter.extraEnvsonly supports plain string values due to how the template renders them:This makes it impossible to reference Kubernetes secrets (e.g. secretKeyRef) for sensitive values like passwords, which is a common requirement when running Valkey with authentication enabled and wanting to scrape metrics via redis_exporter.
Fix: update the template in statefulset.yaml and deploy_valkey.yaml to check the value type:
This is backwards compatible, plain string values continue to work, while map values are treated as valueFrom blocks.