-
Notifications
You must be signed in to change notification settings - Fork 1k
Open
Description
Description
Yes. The current values.yaml
only allows limited configuration of environment variables using static name
+ value
key-pairs. It does not support valueFrom
, nor does it provide a flexible passthrough of full environment variable definitions.
This limits dynamic use cases, such as injecting environment variables via the Downward API:
- name: DD_ENV
valueFrom:
fieldRef:
fieldPath: metadata.labels['tags.datadoghq.com/env']
Solution
Introduce a new values field such as extraEnv, which allows full passthrough of structured environment variable definitions.
In values.yaml:
extraEnv:
- name: DD_ENV
valueFrom:
fieldRef:
fieldPath: metadata.labels['tags.datadoghq.com/env']
- name: DD_VERSION
valueFrom:
fieldRef:
fieldPath: metadata.labels['tags.datadoghq.com/version']
In the Helm chart deployment template:
env:
{{- with .Values.extraEnv }}
{{- toYaml . | nindent 10 }}
{{- end }}
This approach provides complete flexibility without the need to hardcode Helm logic for value or valueFrom.
Metadata
Metadata
Assignees
Labels
No labels