Skip to content

feat(workspaces): provision a local k3s cluster in Docker with one click - #455

Merged
edenreich merged 1 commit into
mainfrom
feat/local-cluster
Nov 7, 2026
Merged

edenreich merged 1 commit into
mainfrom
feat/local-cluster

Conversation

@edenreich

@edenreich edenreich commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Settings > Workspaces gets a one-click Provision local cluster icon button, shown whenever Docker is running. One click gives you a working ubuntu-desktop workspace with no other tooling installed (no k3d, ctlptl, kubectl, yq or task):

  • runs k3s as a Docker container (infer-k3s)
  • installs agent-sandbox and the Inference Gateway operator inside it
  • builds the computer-use Ubuntu desktop image and loads it into the cluster
  • adds the cluster to your kubeconfig
  • registers the ubuntu-desktop workspace in ~/.infer/daemon.yaml

Agents whose workspace is ubuntu-desktop then get a desktop pod of their own after Restart CLI now.

Changes

  • backend/src/local_cluster.rs (new): the Docker and k3s side.
    • Starts or creates the k3s container. Its API listens on a fixed local port chosen at creation, so the kubeconfig survives restarts.
    • Waits for the API and the Gateway API CRDs (bundled with k3s's Traefik), then installs agent-sandbox v1.0.8 and operator v0.29.0 through the container's own kubectl.
    • Builds agent-computer:local from the embedded examples/computer-use/desktop files, using the installed infer version, and streams it into containerd with docker save | ctr images import.
    • Answers a standalone kubeconfig renamed to the infer-k3s context. Every step can be repeated, so a second click repairs or refreshes the cluster.
  • backend/src/workspace_settings.rs:
    • provision_local_cluster (streams progress over a Channel) and docker_available commands.
    • The local cluster's namespace is created and labelled for the operator.
    • The kubeconfig is merged by entry name, keeping the current context. An unreadable kubeconfig is refused, never overwritten.
    • The workspace has the desktop image, computer use without approvals (the pod is the agent's own), and the saved provider keys as gateway_env.
    • Provisioning stops before touching anything if an ubuntu-desktop workspace already points at another cluster.
    • kubectl for the infer-k3s context goes through the container, so Check workspace and Clean up machines work without kubectl on the host.
    • In mock mode, only the workspace is registered.
  • frontend/components/WorkspacesTab.tsx, frontend/lib/tauri.ts: the Provision local cluster button streams each stage into the tab's notice line, plus a hint when Docker is missing.
  • AGENTS.md: the DOM contract lists the new button.
  • e2e/tests/workspace-provision.yaml: the mock-mode walkthrough.

TODO left in local_cluster.rs: pull the desktop image from a published registry instead of building it locally.

Docs follow-up: inference-gateway/docs#1124

@edenreich
edenreich merged commit 926accf into main Nov 7, 2026
1 check passed
@edenreich
edenreich deleted the feat/local-cluster branch November 7, 2026 21:59
@inference-gateway-maintainer

Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 0.57.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

@inference-gateway-maintainer inference-gateway-maintainer Bot added the released Shipped in a release label Nov 7, 2026
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.

1 participant