Skip to content

feat(orchestrator): mount existing claims into a sandbox - #340

Merged
edenreich merged 1 commit into
mainfrom
feat/sandbox-volumes
Nov 10, 2026
Merged

edenreich merged 1 commit into
mainfrom
feat/sandbox-volumes

Conversation

@edenreich

@edenreich edenreich commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

Summary

A Sandbox's own volumes start empty, so an app installed by spec.userData is downloaded again on every pod, and sessions have no way to share content. spec.sandbox.volumes mounts PersistentVolumeClaims that already exist in the Orchestrator's namespace into the daemon's container, read-only where asked.

sandbox:
  volumes:
    - name: footage
      claimName: raw-footage
      mountPath: /mnt/footage
      readOnly: true

Closes #339

Changes

  • SandboxVolume (name, claimName, mountPath, readOnly) and spec.sandbox.volumes on the Orchestrator, at most 16 entries.
  • sandboxPodTemplate adds each claim as a pod volume and a mount on the daemon's container. readOnly is set on both the claim source and the mount. The claims are plain pod volumes, not volumeClaimTemplates, so the Sandbox never owns them.
  • Admission rejects a relative mountPath or /, a path that is or lies under /workspace, /home/infer/.infer/projects or /var/lib/cloud/seed/nocloud, two volumes sharing a path or a name, an empty claimName and a name that is not a DNS label.
  • sandboxState reports the Sandbox's PodScheduled condition when it is false, so a claim that does not exist shows up as Ready=False with the scheduler's reason.
  • A pod that mounts a claim sets fsGroupChangePolicy: OnRootMismatch, so a large shared volume is not walked on every boot. A pod without volumes keeps its template, so upgrading the operator does not cycle existing Sandboxes.
  • README section "Mount existing claims", the sandbox sample, and regenerated deepcopy, CRD and manifests/.

Where this differs from the issue

  • Names are prefixed, not rejected. The pod volume is named claim-<name>, so a name can never collide with a volume the operator owns (workspace, state, user-data, binding-tls, agents-config, mcps-config). The issue asked to reject colliding names.
  • A missing claim is reported through the scheduler. The operator does not look the claim up, so it needs no new RBAC, and any other unschedulable reason is reported the same way.

Not verified

  • test/e2e/orchestrator_sandbox_test.go is extended to mount a read-only claim, check that a write fails and that the claim survives the Sandbox's expiry. It compiles but was not run locally.
  • No test covers a mounted claim together with spec.userData (hostUsers: false) or a runtimeClassName. That acceptance criterion of [FEATURE] Mount existing claims into an Orchestrator's sandbox #339 is still open.

Docs follow-up

inference-gateway/docs#1186

A Sandbox's own volumes start empty, so an app installed by user-data is downloaded again on every pod, and sessions had no way to share content.

spec.sandbox.volumes mounts PersistentVolumeClaims that already exist in the Orchestrator's namespace into the daemon's container, read-only where asked. The Sandbox never owns such a claim, so a suspension, the retention and deleting the Orchestrator leave it in place. An unscheduled pod, such as one whose claim is missing, now reports the scheduler's reason on the Orchestrator.

Closes #339
@edenreich
edenreich marked this pull request as ready for review November 10, 2026 23:36
@edenreich
edenreich requested a review from a team as a code owner November 10, 2026 23:36
@edenreich
edenreich merged commit d449297 into main Nov 10, 2026
1 check passed
@edenreich
edenreich deleted the feat/sandbox-volumes branch November 10, 2026 23:43
inference-gateway-releaser Bot added a commit that referenced this pull request Nov 10, 2026
## [0.36.0](v0.35.0...v0.36.0) (2026-11-10)

### ✨ Features

* **orchestrator:** mount existing claims into a sandbox ([#340](#340)) ([d449297](d449297)), closes [#339](#339)

### 🔧 Miscellaneous

* **deps:** bump claude-code 2.1.308 -> 2.1.318 ([#338](#338)) ([9501dcd](9501dcd))
@inference-gateway-releaser

Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 0.36.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

@inference-gateway-releaser inference-gateway-releaser Bot added the released Shipped in a release label Nov 10, 2026
edenreich added a commit to inference-gateway/cli that referenced this pull request Nov 11, 2026
## Summary

A session's own `storage` starts empty and `user_data` runs again on
every boot, so a heavy app is installed again on each machine and
sessions have no way to share content. A Kubernetes workspace in
`daemon.yaml` now takes `volumes`, each an existing
PersistentVolumeClaim of its namespace.

```yaml
workspaces:
  - name: ubuntu-desktop
    kind: kubernetes
    volumes:
      - name: footage
        claim: raw-footage
        mount_path: /mnt/footage
        read_only: true
```

`read_only` is for content an agent copies before it changes it, so the
original stays as it is.

Closes #1803

## Changes

- `WorkspaceVolume` (`name`, `claim`, `mount_path`, `read_only`) and
`volumes` on `WorkspaceEntry` in `config/daemon.go`.
- Loading `daemon.yaml` rejects a volume without a name or a claim, a
name used twice and a `mount_path` that is not absolute. Volumes on a
workspace that is not `kind: kubernetes` are refused.
- `orchestrator()` sends the list as `spec.sandbox.volumes`, which
inference-gateway/operator#340 adds.
- `requiredOperatorVersion` names `v0.36.0` when a workspace has
volumes, so an older operator fails with the upgrade message.
- `docs/daemon.md` and `docs/configuration-reference.md` document the
key.

## Notes for the reviewer

- **`v0.36.0` is assumed.** It is the next minor release after operator
0.35.0, where inference-gateway/operator#340 is expected to land. The
constant and the docs line change if it ships under another version.
- **Volumes are fixed when a session is created,** like `user_data`. The
CLI only patches a running session's operating mode, so a changed list
reaches the sessions teleported after it.
- **`examples/session-teleport/daemon.yaml` is not changed,** although
#1803 asks for it. The example is runnable, and a volume there needs a
claim manifest and an operator release that does not exist yet.
- A workspace on `compute` keeps its volumes with no extra code, since
compute sets the connection fields only.
- Not run against a cluster. Depends on inference-gateway/operator#340.

## Docs follow-up

inference-gateway/docs#1188
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

released Shipped in a release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

1 participant