Skip to content

[FEATURE] Mount existing claims into an Orchestrator's sandbox #339

Description

@edenreich

Summary

An Orchestrator with runtime: Sandbox cannot mount anything besides the two per-session volumes the operator creates (workspace and state, both from spec.sandbox.storage) and the user-data Secret. Every session therefore starts empty, and a heavy app installed through user_data is downloaded and installed again on every pod boot - DaVinci Resolve is about 1.8GB.

Add spec.sandbox.volumes, a list of existing PersistentVolumeClaims to mount into the daemon container:

spec:
  runtime: Sandbox
  sandbox:
    storage: 5Gi
    volumes:
      - name: resolve
        claimName: davinci-resolve
        mountPath: /opt/resolve
      - name: footage
        claimName: raw-footage
        mountPath: /mnt/footage
        readOnly: true

Two use cases drive it, and agent-sandbox's own storage guide (examples/latebind-storage-gke-sandbox) names both:

  • Collaborative - an app or cache volume shared by sessions, so an install happens once.
  • Exploration branching - a read-only base, such as raw footage, that the agent copies into its private workspace before editing. The original can never be changed, which is why readOnly is part of the definition.

Findings from agent-sandbox v1.0.10 (agents.x-k8s.io/v1beta1) that shape the design:

  • Sandbox.spec.podTemplate.spec is a full PodSpec, so nothing upstream blocks an extra volume or a read-only mount. This is an operator-only change in sandboxPodTemplate (internal/controller/orchestrator_sandbox.go).
  • volumeClaimTemplates do not fit. They are per-Sandbox, created empty, owned and garbage-collected with the Sandbox, and immutable after creation. A referenced claim must be a plain pod volume instead.
  • A changed pod template only reaches the next pod. The operator already hashes the template and cycles the Sandbox through Suspended, so a changed volume list should roll out the same way.
  • The source is an existing claim only. A hostPath source is refused under the Kubernetes baseline pod security level, so it does not belong in this API. A client that wants a host folder creates a static PersistentVolume and claim itself.
  • The pod runs as the daemon's non-root user with an fsGroup, and with spec.userData it runs in its own user namespace (hostUsers: false). A mounted claim must work in both.

spec.pod.volumes from #316 is not enough on its own: it adds a volume for sidecar containers but no mount on the operator's container, and the Orchestrator has no spec.pod.

Out of scope, possible follow-ups: a writable per-session clone of a golden volume through dataSource on a claim template, image volumes, and SandboxTemplate / SandboxWarmPool. For app installs alone, a custom image with the app baked in is the alternative that needs no operator change - a node pulls it once and caches it.

Acceptance Criteria

  • spec.sandbox.volumes accepts entries of name, claimName, mountPath and optional readOnly (default false)
  • Each entry becomes a persistentVolumeClaim volume and a mount on the daemon container, next to workspace and state
  • readOnly: true is set on both the claim source and the volume mount
  • A name that collides with workspace, state or user-data, or a mount path that collides with or nests under theirs, is rejected with a clear message
  • A referenced claim is never owned by the Sandbox: suspension, retention, shutdownTime and deleting the Orchestrator leave it and its data in place
  • Changing the list on a running Orchestrator rolls out through the existing template-hash suspend and resume
  • A claim that does not exist is reported on the Orchestrator's status instead of only a pod stuck Pending
  • Mounts work with spec.userData set (hostUsers: false) and with a runtimeClassName, covered by a test
  • The docs state the access-mode rule: a ReadWriteOnce claim is shared within one node only, and sessions on several nodes need ReadWriteMany or ReadOnlyMany
  • The CRD is regenerated and the sample and API reference are updated

Activity

  1. added
    enhancement
    on Nov 10, 2026
  2. moved this to Todo in 2026on Nov 10, 2026
  3. moved this from Todo to In progress in 2026on Nov 10, 2026
  4. moved this from In progress to QA in 2026on Nov 10, 2026
  5. inference-gateway-releaser commented on Nov 10, 2026

    @inference-gateway-releaser
    Contributor

    🎉 This issue has been resolved in version 0.36.0 🎉

    The release is available on GitHub release

    Your semantic-release bot 📦🚀

  6. moved this from QA to Done in 2026on Nov 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementreleased

    Projects

    • Status
      Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions