Skip to content

feat(k8s): support ImageVolumeSource for supervisor sideload#1300

Open
mrunalp wants to merge 2 commits intoNVIDIA:mainfrom
mrunalp:feat/image-volume-sideload
Open

feat(k8s): support ImageVolumeSource for supervisor sideload#1300
mrunalp wants to merge 2 commits intoNVIDIA:mainfrom
mrunalp:feat/image-volume-sideload

Conversation

@mrunalp
Copy link
Copy Markdown
Collaborator

@mrunalp mrunalp commented May 10, 2026

Summary

Add a config-driven switch for how the supervisor binary is delivered into
sandbox pods: image-volume (default) mounts the supervisor OCI image directly
as a read-only volume via Kubernetes ImageVolumeSource (GA in v1.36), while
init-container preserves the existing emptyDir + copy-self pattern for older
clusters. This eliminates the init container overhead and simplifies the pod spec.

Related Issue

Closes #1299

Changes

  • Add SupervisorSideloadMethod enum (ImageVolume default, InitContainer)
    with FromStr/Display/Default in config.rs
  • Add supervisor_image_volume() helper in driver.rs that emits an image
    volume source JSON
  • Modify apply_supervisor_sideload() to branch on the method — ImageVolume
    skips the init container, InitContainer preserves existing behavior
  • Thread supervisor_sideload_method through SandboxPodParams,
    sandbox_to_k8s_spec, and sandbox_template_to_k8s
  • Add --supervisor-sideload-method CLI arg / OPENSHELL_SUPERVISOR_SIDELOAD_METHOD
    env var in main.rs
  • Wire env var in openshell-server/src/lib.rs
  • Add supervisor.sideloadMethod Helm value (default: image-volume) and pass
    it via statefulset.yaml
  • Add 2 new unit tests for the ImageVolume path; update 11 existing test call sites

Testing

  • mise run pre-commit passes
  • Unit tests added/updated (2 new tests, 11 existing updated)
  • E2E tests added/updated (not applicable — e2e uses Docker driver, not Kubernetes)
  • Manual cluster test on Kubernetes v1.37 / CRI-O 1.36: sandbox pod runs
    with image volume source, no supervisor init container present

Checklist

  • Follows Conventional Commits
  • Commits are signed off (DCO)
  • Architecture docs updated (test plan in architecture/plans/)

Add a config-driven switch between two supervisor binary delivery
methods: image-volume (default) mounts the supervisor OCI image
directly as a read-only volume (K8s >= v1.33), while init-container
preserves the existing emptyDir + copy-self pattern for older clusters.

Configurable via --supervisor-sideload-method CLI arg,
OPENSHELL_SUPERVISOR_SIDELOAD_METHOD env var, or Helm
supervisor.sideloadMethod value.
@mrunalp mrunalp requested review from a team, derekwaynecarr and maxamillion as code owners May 10, 2026 00:40
@copy-pr-bot
Copy link
Copy Markdown

copy-pr-bot Bot commented May 10, 2026

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.

Copy link
Copy Markdown
Collaborator

@TaylorMutch TaylorMutch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we use Capabilities feature in Helm to configure which mode to use in the chart? https://helm.sh/docs/chart_template_guide/builtin_objects

And then if a user specifies explicitly which mode to use in the helm values use that?

Use Helm .Capabilities.KubeVersion to choose the supervisor sideload
method automatically: image-volume on K8s >= v1.33, init-container on
older clusters. An explicit supervisor.sideloadMethod value overrides
auto-detection.
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.

feat(k8s): Support ImageVolumeSource for supervisor binary sideload

2 participants