Skip to content

Add configurable env vars to health-monitoring-agent DaemonSets - #465

Open
nitishsaik wants to merge 1 commit into
aws:mainfrom
nitishsaik:add-hma-env-values
Open

nitishsaik wants to merge 1 commit into
aws:mainfrom
nitishsaik:add-hma-env-values

Conversation

@nitishsaik

Copy link
Copy Markdown

Introduce a .Values.env range block in both the nvidia and non-nvidia HMA DaemonSets so custom environment variables can be injected via values, rendered before the
built-in NODE_NAME/NODE_IP fieldRef vars. Add env: [] default in values.yaml.

What's changing and why?

The health-monitoring-agent chart previously hardcoded the container env list in both DaemonSets (health-monitoring-agent and
health-monitoring-agent-non-nvidia), so there was no way to inject additional environment variables without editing the template. This change adds a {{- range .Values.env }} block to both DaemonSets, allowing custom env vars to be supplied through Helm values. The custom vars render first, followed by the existing built-in
NODE_NAME/NODE_IP fieldRef variables (and, on the non-nvidia DaemonSet, NVIDIA_VISIBLE_DEVICES/NVIDIA_DRIVER_CAPABILITIES). A default of env: [] is added to
values.yaml so the chart's behavior is unchanged unless the user explicitly sets values.

Before/After UX

Before:
Container env was fixed to NODE_NAME and NODE_IP (plus the two NVIDIA_* vars on the non-nvidia DaemonSet). Adding an env var required editing the template
directly.

After:
Users can inject env vars via values, e.g.:

yaml env: - name: FOO value: bar - name: BAZ value: qux ​

Rendered result (both DaemonSets):

yaml env: - name: FOO value: "bar" - name: BAZ value: "qux" - name: NODE_NAME valueFrom: fieldRef: fieldPath: spec.nodeName - name: NODE_IP valueFrom: fieldRef: fieldPath: status.hostIP ​

With no env set (the default []), output is identical to before — no leftover template artifacts.

How was this change tested?

Rendered the chart locally with Helm 4.3.0:

  • helm template with default (empty) env: renders cleanly, output matches the pre-change template with no artifacts.
  • helm template --set env[0].name=FOO --set env[0].value=bar --set env[1].name=BAZ --set env[1].value=qux: confirmed custom vars render first (quoted), followed by
    NODE_NAME/NODE_IP, in both DaemonSets.
  • helm lint .: passed (0 charts failed).

Are unit tests added?

No. This chart has no existing unit test harness (e.g., helm-unittest); the change was verified via helm template/helm lint rendering checks instead.

Are integration tests added?

No. This is a templating-only change to a Helm chart with no runtime logic; validated through Helm rendering as above.

Reviewer Guidelines

‼️ Merge Requirements: PRs with failing integration tests cannot be merged without justification.

One of the following must be true:

  • All automated PR checks pass
  • Failed tests include local run results/screenshots proving they work — verified locally via helm template (empty + populated env) and helm lint (0 failures)
  • Changes are documentation-only

Introduce a .Values.env range block in both the nvidia and non-nvidia
HMA DaemonSets so custom environment variables can be injected via values,
rendered before the built-in NODE_NAME/NODE_IP fieldRef vars.
Add env: [] default in values.yaml.
@nitishsaik
nitishsaik requested a review from a team as a code owner September 18, 2026 21:54
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.

1 participant