Skip to content

fix(container-cache): run the ownership init container from the certificates image - #2938

Merged
balajinvda merged 1 commit into
mainfrom
fix/container-cache-init-image-from-values
Oct 27, 2026
Merged

balajinvda merged 1 commit into
mainfrom
fix/container-cache-init-image-from-values

Conversation

@balajinvda

@balajinvda balajinvda commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

TL;DR

The init-chown-data init container was the only image in the chart not taken from values: a hard-coded public CUDA base image. With an org-scoped pull secret on the pod, that pull fails with insufficient_scope and a recreated cache pod sits in Init:ImagePullBackOff, stalling the StatefulSet rollout. The init container now runs from images.init, defaulting to images.certificates, so the whole pod comes from one registry org with one pull secret and no extra image or mirror is needed.

Additional Details

  • The container only needs bash, chown, chmod and find. The certificates image (Ubuntu 22.04) has them and is already pulled by the next init container in the same pod with the same secret.
  • That image carries busybox symlinks for chown/chmod/find under /usr/local/bin ahead of coreutils; the init command now pins PATH=/usr/bin:/bin:$PATH so the distribution coreutils are used. The exact rendered command was run inside the image against volumes containing a .snapshot directory: root 755 and owner 1000:1000 set, .snapshot skipped, GNU chown confirmed.
  • images.init stays overridable for anyone who prefers a dedicated mirrored base image.
  • tests/chart-render/verify-init-image.sh: no rendered image points at a public registry org, the init container defaults to the certificates image, the override works, and the PATH pin is present.

For the Reviewer

  • deploy/templates/statefulset.yaml: image line and the export PATH prefix are the whole functional change.
  • Behaviour on clusters where the public image still pulls fine is unchanged except for the image swap.

For QA

Issues

Fixes #2937

Checklist

  • I am familiar with the Contributing Guidelines.
  • I have signed off my commits for Developer Certificate of Origin (DCO) compliance.
  • New or existing tests cover these changes.
  • The documentation is up to date with these changes.

Summary by CodeRabbit

  • New Features
    • Added an images.init setting to configure the image used by the cache initialization container. When left empty, it uses the certificates image.
    • Documented the initialization image’s required tools: Bash, chown, chmod, and find.
    • The initialization container now sets a standard command search path before running its existing ownership and permission operations.

…ficates image

The init container that fixes cache volume ownership was the only image
in the chart not taken from values: a public CUDA base image. Once the
pod carried an org-scoped pull secret, containerd presented that secret
to the public org and the pull failed with insufficient_scope, so a
recreated cache pod sat in Init:ImagePullBackOff and the StatefulSet
rollout stalled at 2/3.

The container only needs bash, chown, chmod and find. It now runs from
images.init, which defaults to images.certificates: the same registry
org and pull secret as every other image in the pod, so no mirror or
extra image is needed. PATH is pinned so the distribution coreutils win
over busybox symlinks that image carries under /usr/local/bin. The exact
rendered command was run inside that image against volumes containing a
.snapshot directory: ownership set, .snapshot skipped.

tests/chart-render/verify-init-image.sh checks that no image points at a
public registry org, that the init container defaults to the
certificates image, that it is overridable, and that the PATH pin is in
the rendered command.

Co-Authored-By: Balaji Ganesan <bganesan@nvidia.com>
Signed-off-by: Balaji Ganesan <bganesan@nvidia.com>
@balajinvda
balajinvda requested a review from a team as a code owner October 27, 2026 18:42
@coderabbitai

coderabbitai Bot commented Oct 27, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
Commits

Reviewing files that changed from the base of the PR and between f83ad8d and 92eddca.

Files selected for processing: 4
  • deploy/helm/container-cache/README.md
  • deploy/helm/container-cache/deploy/templates/statefulset.yaml
  • deploy/helm/container-cache/deploy/values.yaml
  • deploy/helm/container-cache/tests/chart-render/verify-init-image.sh

Included review availability: This review used your included allowance. Your plan provides up to 12 included reviews per hour; 11 remain after this review.

Walkthrough

The container-cache chart adds a configurable image for the cache-volume ownership init container. When unset, the chart uses the certificates image. The init command sets PATH before running its existing permission and ownership operations. A chart-render script checks default and custom image configurations.

Changes: Container-cache init image

Layer / File(s) Summary
Configure and verify the init image
deploy/helm/container-cache/deploy/values.yaml, deploy/helm/container-cache/deploy/templates/statefulset.yaml, deploy/helm/container-cache/README.md, deploy/helm/container-cache/tests/chart-render/verify-init-image.sh
The chart adds images.init, defaulting to the certificates image when unset. The ownership init container uses that value and prepends /usr/bin:/bin to PATH. The README documents the setting, and the render checks verify the default and custom image output and init command.

Priority: Normal

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix · Severity of issue fixed: Medium

Suggested reviewers: sbaum1994

Merge Risk: Minimal · up to 92edd

No actionable merge-blocking defect is established; proceed with the reported normal render, lint, and rollout validation.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Documentation-only edits and deletions within survi… Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title uses the fix type with the required container-cache scope and follows the Conventional Commits grammar. The diff switches the init-chown-data container from a hard-coded public CUDA image to…
Linked Issues check Passed Issue #2937 requires a chart-valued init image, a default to an image already used by the pod, and removal of the public CUDA image from rendered output. values.yaml defines images.init with an em…
Out of Scope Changes check Passed The changes stay within issue #2937. The PATH pin protects the required ownership commands when the certificates image contains busybox symlinks. The values comment, README entry, and render test docu…
Full details: Title check

Explanation

The title uses the fix type with the required container-cache scope and follows the Conventional Commits grammar. The diff switches the init-chown-data container from a hard-coded public CUDA image to a configurable images.init value that falls back to images.certificates, and it pins PATH. That is a bug fix for the public-image pull failure (insufficient_scope) that stalls StatefulSet rollouts, so the fix type reflects the primary nature of the change. The title's wording about running from the certificates image matches the default fallback, though it omits the new configurable value and PATH pin.

Full details: Linked Issues check

Explanation

Issue #2937 requires a chart-valued init image, a default to an image already used by the pod, and removal of the public CUDA image from rendered output. values.yaml defines images.init with an empty default. statefulset.yaml uses images.init | default images.certificates for init-chown-data. The same template pins the command to distribution coreutils. verify-init-image.sh checks the default image, the override, the PATH prefix, and the absence of nvcr.io/nvidia/ in rendered output.

Full details: Out of Scope Changes check

Explanation

The changes stay within issue #2937. The PATH pin protects the required ownership commands when the certificates image contains busybox symlinks. The values comment, README entry, and render test document and verify the new image value and its fallback. No unrelated product behavior is changed.

Full details: Docstring Coverage

Explanation

Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 2 functions across 1 files. (3 skipped: 3 unsupported.)

Resolution

Write docstrings for the functions missing them to satisfy the coverage threshold.

Finishing Touches: 💡 1
📝 Generate docstrings: 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

@balajinvda
balajinvda added this pull request to the merge queue Oct 27, 2026
Merged via the queue into main with commit 25be4ed Oct 27, 2026
23 checks passed
@balajinvda
balajinvda deleted the fix/container-cache-init-image-from-values branch October 27, 2026 20:01
@balajinvda

Copy link
Copy Markdown
Contributor Author

🎉 This PR is included in deploy/helm/container-cache/v0.30.8 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

container-cache: ownership init container pulls a hard-coded public base image

2 participants