Skip to content

feat: Expose pod index as a label to allow user-defined env vars to reference it via Downward API#505

Merged
julienmancuso merged 1 commit into
ai-dynamo:mainfrom
julienmancuso:jsm/pod-index-label-fieldref
Apr 1, 2026
Merged

feat: Expose pod index as a label to allow user-defined env vars to reference it via Downward API#505
julienmancuso merged 1 commit into
ai-dynamo:mainfrom
julienmancuso:jsm/pod-index-label-fieldref

Conversation

@julienmancuso

@julienmancuso julienmancuso commented Apr 1, 2026

Copy link
Copy Markdown
Contributor

What type of PR is this?

/kind feature

What this PR does / why we need it:

As a PCS user, I want to define custom environment variables (e.g. ENGINE_ID for Dynamo) that are derived from GROVE_PCLQ_POD_INDEX. This is not possible today because the operator injects GROVE_PCLQ_POD_INDEX as a direct value at pod creation time -- there is no label or field users can reference via the Kubernetes Downward API in their own env var definitions.

This PR:

  • Adds a new pod label grove.io/podclique-pod-index carrying the pod's index within its PodClique.
  • Changes GROVE_PCLQ_POD_INDEX from a direct-value env var to one sourced via fieldRef from that label.

This follows the same pattern already used for GROVE_PCSG_INDEX / GROVE_PCSG_NAME.

Users can now define their own env vars referencing the pod index:

env:
  - name: ENGINE_ID
    valueFrom:
      fieldRef:
        fieldPath: metadata.labels['grove.io/podclique-pod-index']

Which issue(s) this PR fixes:

Fixes #506

Special notes for your reviewer:

This is a backward-compatible change. GROVE_PCLQ_POD_INDEX still resolves to the same value at runtime -- the only difference is that it is now sourced from a pod label via fieldRef instead of being set as a direct value.

Does this PR introduce a API change?

Add `grove.io/podclique-pod-index` label to pods, allowing users to reference the pod index via the Kubernetes Downward API in custom environment variables. `GROVE_PCLQ_POD_INDEX` is now sourced from this label via fieldRef.

Additional documentation e.g., enhancement proposals, usage docs, etc.:

NONE

…eference it via Downward API

Signed-off-by: Julien Mancuso <jmancuso@nvidia.com>
@gflarity gflarity force-pushed the jsm/pod-index-label-fieldref branch from bb81d87 to f73b6b1 Compare April 1, 2026 14:13
@copy-pr-bot

copy-pr-bot Bot commented Apr 1, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@gflarity

gflarity commented Apr 1, 2026

Copy link
Copy Markdown
Contributor

/ok to test

@copy-pr-bot

copy-pr-bot Bot commented Apr 1, 2026

Copy link
Copy Markdown

/ok to test

@gflarity, there was an error processing your request: E1

See the following link for more information: https://docs.gha-runners.nvidia.com/cpr/e/1/

@gflarity

gflarity commented Apr 1, 2026

Copy link
Copy Markdown
Contributor

/ok to test f73b6b1

@julienmancuso julienmancuso merged commit 4fe1034 into ai-dynamo:main Apr 1, 2026
38 of 40 checks passed
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.

Expose pod index as a pod label and source env var from it via fieldRef

3 participants