Skip to content

feat(teleport): run kubernetes workspaces as operator Orchestrators - #1660

Merged
edenreich merged 2 commits into
mainfrom
feat/teleport-operator-orchestrator
Oct 31, 2026
Merged

edenreich merged 2 commits into
mainfrom
feat/teleport-operator-orchestrator

Conversation

@edenreich

@edenreich edenreich commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor

Summary

A kind: kubernetes workspace now creates one Inference Gateway operator Orchestrator per session with runtime: Sandbox, instead of building an agent-sandbox Sandbox and its pod itself. A teleport to a cluster without the operator fails at provisioning before anything is created. This covers the operator todo on #1653.

Requires operator v0.28.1 or later (inference-gateway/operator#298, inference-gateway/operator#302).

Changes

  • internal/agent/infrastructure/kubernetes/workspace.go
    • requireOperator asks discovery for core.inference-gateway.com/v1alpha1 orchestrators before anything else. Without it, Ensure, Reach and Probe report the Inference Gateway operator is not installed in the cluster of workspace <name>. No Secret or Orchestrator is created.
    • The Orchestrator spec sets the image, runtime: Sandbox, sandbox (storage, retention, operating mode), and a binding authenticated by the session's Secret with mTLS. It also sets tools.enabled and a2a.enabled, which the operator would otherwise force off, and the workspace env.
    • The Orchestrator is created with strict field validation, so an operator that predates runtime: Sandbox refuses spec.runtime instead of running a Deployment.
    • awaitReady waits for Ready at the current generation and returns status.podName. It resumes an Orchestrator found suspended, including one the operator parks during the wait. It fails fast on SandboxCRDMissing and InvalidSpec.
    • The Secret is owned by the Orchestrator. The pod spec, readiness probe, volume claims and self-suspend env are gone, since the operator owns them now.
  • Pod side: the operator's pod has no Kubernetes API access. An idle pod daemon writes agents-done=<bool> to /dev/termination-log and exits 0, and the operator parks the Orchestrator and starts its retention. SelfSuspend, teleport.Service.Suspend and its dep are removed. Registry.AgentsDone returns a single bool.
  • examples/session-teleport
    • task cluster:create installs operator v0.28.1 after agent-sandbox, because the operator looks for agent-sandbox only at startup. k3s already ships the Gateway API CRDs the operator needs.
    • The self-suspend ServiceAccount and Role are dropped.
    • The desktop image is unchanged. v0.28.1 keeps its entrypoint, which starts Xvfb and Chromium before the daemon.
  • Docs: docs/daemon.md (prerequisites, kubeconfig RBAC, abort behavior, retention), the protocol and commands references, the session-teleport README and troubleshooting, and the agent and sessions READMEs.

Cross-repo

Out of scope

  • runtime_class (gVisor or Kata) in daemon.yaml. The operator supports it, but nobody asked for it yet.
  • The per-workspace gateway and the protocol-choice todos on chore(release): 0.239.0-rc.9 [skip ci] #1653.
  • Bare Sandbox objects that earlier release candidates left behind share the new Orchestrator names. Delete them by hand (see the example's troubleshooting).

Test plan

  • go test -race for internal/agent/..., internal/sessions/... and cmd/daemon/..., plus task test
  • task precommit:run
  • k3d infer-workspaces without the operator: infer daemon workspaces and infer daemon teleport --to k8s-dev report the operator missing, the session stays on the laptop, and no new Secret is created
  • With operator v0.28.1: teleport to k8s-dev shows RUNTIME Sandbox and READY true, and a turn runs on the pod
  • Idle exit set to 1m: the pod exits 0, the operator suspends the Orchestrator, the Sandbox gets agents-done=true and a 24h shutdownTime, and the next turn resumes it with the countdown cleared
  • infer daemon teleport --to laptop brings the session back, and that pod reports agents done
  • infer daemon stop deletes the Orchestrator, its Secret and both volumes
  • task demo TARGET=k8s-desktop PROMPT="browse to example.com" on v0.28.1 with the unchanged desktop image: the pod runs the image entrypoint with args ["daemon"], and task desktop:screenshot shows Chromium on example.com under the operator's non-root pod without capabilities
  • task chat walkthrough in the TUI: say hello on ⌂ laptop, /workspaces lists both Kubernetes workspaces reachable with their orchestrator count, teleport to k8s-desktop, browse to example.com runs every Computer call in the pod, /teleport laptop brings it back and the next turn answers locally
  • The recording of that run lands in RustFS under the session id (task artifacts:list)

A kubernetes workspace now creates one Inference Gateway operator
Orchestrator per session with runtime: Sandbox, instead of building an
agent-sandbox Sandbox and its pod itself. A teleport to a cluster that
does not serve Orchestrators fails at provisioning, before the TLS
Secret or anything else is created, and /workspaces reports the same.

The operator's pod has no Kubernetes API access, so the pod daemon no
longer suspends its own Sandbox. When it idles out it leaves
agents-done=<bool> as its termination message, and the operator parks
the Orchestrator and starts its retention. A client resumes it by
setting spec.sandbox.operatingMode back to Running.

The session-teleport example installs operator v0.28.0 after
agent-sandbox, drops the self-suspend RBAC, and starts the desktop from
an infer wrapper on PATH, since the operator runs the pod's infer
daemon by name.

Requires operator v0.28.0 or later.
…apper

Operator v0.28.1 keeps the image entrypoint and passes daemon as its
argument (inference-gateway/operator#302). The session-teleport example
pins it, and the desktop image starts Xvfb and Chromium from its own
entrypoint again instead of an infer wrapper on PATH. The docs and the
operator-missing error name v0.28.1 as the minimum.
@edenreich
edenreich merged commit e1b3777 into main Oct 31, 2026
1 check passed
@edenreich
edenreich deleted the feat/teleport-operator-orchestrator branch October 31, 2026 17:41
@inference-gateway-releaser

Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 0.239.0-rc.10 🎉

The release is available on:

Your semantic-release bot 📦🚀

@inference-gateway-releaser inference-gateway-releaser Bot added the rc Shipped in a release candidate label Oct 31, 2026
@inference-gateway-releaser

Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 0.239.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@inference-gateway-releaser inference-gateway-releaser Bot added the released Shipped in a release label Oct 31, 2026
@edenreich edenreich moved this from Todo to Done in 2026 Oct 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

rc Shipped in a release candidate released Shipped in a release

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant