Skip to content

Add Support for Full env Passthrough Using extraEnv in Datadog Operator Chart #1923

@barucijah

Description

@barucijah

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

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions