Skip to content
giantswarmPublic

About

Run the Giant Swarm agent platform locally: muster + Kubernetes MCP (optionally Backstage) on a throwaway kind cluster, with a bundled Dex as IdP

Resources

Security policy

Stars

25 stars

Watchers

0 watching

Forks

Latest commit

 

History

847 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

agentlab

The Giant Swarm agent platform on your laptop: one binary, one throwaway kind cluster, every chain proven end to end.

Release CI Go License


agentlab runs the Giant Swarm agent platform — muster as the MCP gateway, the Kubernetes MCP server, the kagent agents runtime and Giant Swarm's Backstage portal — on a kind cluster on your machine, so the whole platform can be tested and demoed without a management cluster.

Two kinds of client meet at one gateway. MCP clients such as Claude Code talk to muster directly; people use Backstage, the human frontend to the whole platform — servers, workflows, tools, agents, models — with their own token. The agents Backstage creates run on kagent and are MCP clients of muster too, calling tools as the person who invoked them.

The platform needs an identity provider, so the lab bundles its own Dex: users that exist nowhere but this cluster, RBAC driven by the groups claim, and the apiserver, muster and Backstage all trusting the same issuer.

agentlab architecture: Claude Code and Backstage, the two interfaces on the left, reach the platform through the agentgateway TLS edge into muster. muster fans out to mcp-kubernetes (the kube-apiserver), mcp-prometheus (Prometheus), model-manager (Ollama, Lemonade and LM Studio on the host) and agent-manager. The kagent runtime holds the Agent CRs, run as ADK pods, and the ModelConfigs for Anthropic, Ollama, Lemonade, LM Studio and OpenAI-compatible endpoints; agent-manager creates the Agent CRs, model-manager wires the ModelConfigs, the agents call tools back through muster with the caller's token and toolset, and Backstage chats with them over A2A. The bundled Dex at https://localhost:32000/dex is the one issuer the browser, muster, Backstage and the apiserver trust

What's in the box

  • One Go binary. agentlab configure asks every option through an interactive form and writes agentlab.yaml; every manifest renders from embedded templates. No YAML to hand-edit, no scripts to source.
  • The agent platform. The agent-platform chart every Giant Swarm management cluster runs, installed in its lab shape: muster behind an agentgateway TLS edge, the single OAuth enforcement point in front of an unauthenticated in-cluster mcp-kubernetes. Per-server sign-in, declared toolsets and a fake multi-cluster fleet are all exercised.
  • Backstage, the human frontend. Giant Swarm's Backstage is how a person works the whole platform: browse and sign in to MCP servers, run workflows, explore tools, create agents and chat with them, manage models. Every call carries the signed-in user's own token, so the portal shows exactly what the platform grants that person.
  • Agents. kagent runs the agents Backstage or agent-manager creates. They are MCP clients of muster like Claude Code is, forwarding the caller's token and bounded further by declared toolsets, so they see the same catalogue under the same rules.
  • Models. An Anthropic default; extra model configs for OpenAI-compatible, Gemini and Ollama endpoints; managed models through model-manager fronting the model servers on the host — an Ollama, a Lemonade Server, an LM Studio; and, with platform.serving, the platform's own serving on llm-d — the KServe llmisvc controller, the well-known runtime configs, the models Gateway with its JWT policy, one CPU preset served on the node.
  • Workspaces. With platform.workspaces, the read-write-many storage a workspace's volume is claimed from: an in-cluster NFS server and the NFS CSI driver, its controller behind an mTLS proxy only Agent Substrate's API server may reach, and the StorageClass agentlab-workspaces; agentlab workspaces-test proves sub-path mounts per Session, read-only mirrors and git on the volume, and a claude Session admitted on it with a workspace grant the workspace-manager's key set verifies. With platform.workspaces.csiCompanion the connectivity chart's CSI companion mounts the volumes for Substrate instead, the lab's path for proving a companion change. The workspace-manager's provider instances are a GitHub App of the lab's own and a GitLab; a person grants the App in a browser.
  • VMs. vm-manager, the platform's VM provisioner, as a pod of the KVM node (the chart's components.vm-manager) registered with muster as x_vm-manager_*: VMs with an instance metadata service, a vTPM and attestation, created by the person or an agent who asked.
  • Swarmgeist. klaus-gateway, the fleet's Slack bridge, on the host against the lab's public gRPC edge and — with platform.klausGateway — as the meta chart's in-cluster component with its OBO link store in a Secret, proven across a pod loss. No Slack workspace, so no real sign-in: the store is proven through the gateway's own package.
  • Observability. A minimal Prometheus plus mcp-prometheus, so PromQL questions about the lab go through MCP too.
  • Identity you can reason about. Three throwaway users, a fixed group vocabulary, one issuer URL valid from the host, the node and every hostNetwork pod, and a lab CA you trust explicitly.
  • Network policies, as an installation runs them. With platform.networkPolicy the platform's own policies enforce (the plain NetworkPolicy flavour kind's kindnetd enforces). muster leaves the host network for it: the policies admit muster by its pod labels, and a host-network pod's traffic carries the node's address instead, so a host-network muster would be cut off from every backend. The lab adds only what its shape needs — the node as the apiserver, its in-cluster Dex and Prometheus as peers, and two stand-ins for gaps of the chart's kubernetes flavour (Network policies) — and platform-test proves the denial.
  • The fleet's admission. Kyverno with the flux-multi-tenancy policy every Giant Swarm management cluster enforces, verbatim and in Enforce, and an org namespace with the fleet's tenant ServiceAccount — a release that an installation would refuse is refused here, with the same message.
  • Proofs, not hope. Headless *-test commands drive every chain — Dex login, muster, MCP tools, agents, toolsets, models, RBAC, Backstage — and fail loudly.

Getting started

Requirements: docker (or Podman >= 4's docker-compatible CLI) — nothing else; go >= 1.26 only to build from source. kind, Helm and the Kubernetes client are built into the binary: the cluster runs the Kubernetes of the embedded kind release's default node image, the platform installs through Helm 4's SDK, and every call to the apiserver goes through client-go. Give docker at least 4 CPUs and 6 GiB for the full lab; agentlab up checks before it touches anything (see Docker resources).

GOBIN=~/.local/bin go install github.com/giantswarm/agentlab@latest   # or a release binary in ~/.local/bin; `agentlab self-update` keeps it there

export ANTHROPIC_API_KEY=sk-ant-...   # optional: powers the agents and Backstage's AI chat
agentlab up                           # one question (the detected defaults, or customize), then certs, kind cluster, Dex, RBAC, the platform — verified
agentlab open portal                  # the portal in your browser (the URL is printed too)
agentlab platform-test                # headless proof: Dex -> muster -> mcp-kubernetes -> apiserver
agentlab oauth-consent-test           # CIMD, consent, resource access tokens and replacement of both replicas
agentlab polex-test                   # the chart's Kyverno PolicyExceptions dry-run against the lab's Kyverno (the fleet's)

Headless (CI, a coding agent), write the lab first with agentlab configure --defaults: nothing asks without a terminal. A new lab is named agentlab, or agentlab-<n> when another lab on this machine holds that name; --cluster-name <name> names it. On a terminal, up ends by asking whether to trust the lab CA (one sudo prompt, so browsers get a green lock) and whether to open the portal — open portal is the command for later, open agents opens the kagent UI and open prometheus the lab Prometheus. agentlab list shows the labs on this machine, agentlab status the chart a lab runs (a dev chart named as such) against the one agentlab.yaml installs, with the drift when they differ, its platform releases and whether Backstage's app-config drifted from the render, and agentlab pods a lab's pods, from any directory (--lab <name> picks one of several).

One binary drives one kagent line: this agentlab drives the labs whose chart installs kagent 1.3 or later (agent-platform 4.121.0 and later, kagent's Session API); a lab on an earlier 4.x chart is driven by agentlab v0.84.6, kept beside this one. agentlab list shows each lab's line, and this agentlab refuses to configure, boot, turn or prove a lab on a line it does not drive. Two labs on two lines, each with its binary, side by side on one machine: One binary per kagent line.

Then point Claude Code at the platform:

agentlab trust                # if you said no above: one sudo prompt, `agentlab untrust` reverts it
export NODE_USE_SYSTEM_CA=1   # Node >= 22.15; older Node: NODE_EXTRA_CA_CERTS=~/.local/state/agentlab/labs/<lab>/certs/ca.crt
claude mcp add --transport http muster https://muster.127.0.0.1.nip.io/mcp
# in Claude Code:  /mcp  ->  authenticate  ->  Dex login page  ->  done

The portal (https://portal.127.0.0.1.nip.io) signs in the default users [email protected], [email protected] and [email protected], password password. agentlab down deletes the cluster.

The full walkthrough, including what configure discovers about your machine, is in Getting started.

Proofs

Every chain the lab stands up has a headless *-test command that drives it end to end, prints a PASS, SKIP or FAIL per stage with the reason, and exits non-zero on a failure. The command reference has every flag and stage.

Command What it proves
platform-test Dex → muster → mcp-kubernetes → apiserver, the fleet's admission, per-server sign-in, the infrastructure families
oauth-consent-test CIMD, consent, resource access tokens, and the replacement of both replicas
polex-test The chart's Kyverno PolicyExceptions against the fleet's Kyverno
agents-test agent-manager through muster as the person: create, Ready on the Harness, a turn, update, delete, its RBAC
agents-gitops-test Editing an agent applied from git, as the portal does it
organizations-test Two Agent Platform organizations and the boundary between them on every surface
toolsets-test Declared toolsets from agent-manager to muster's per-request refusal
signin-test An agent's MCP call pausing on the person's sign-in and resuming after it
egress-test An agent's declared origin reached, an undeclared one denied at the egress gate
skills-test The golden boot of an agent with a git skill under Substrate's egress gate
a2a-test Turns over native gRPC through the edge, with human-in-the-loop approval and cancel
coding-test Coding agents on the claude, codex or omp Harness: the security floor, suspend and resume, egress denial, usage; --step <stage> reruns one stage; --part devctl opens, waits for and merges a pull request through devctl; --part toolchains mounts toolchains into a Session
chatgpt-test Codex on a person's own ChatGPT subscription
harness-matrix-test What each Harness does with Shared subagents and Claude-format plugin parts
models-test Managed models through model-manager's tools
serving-test Model serving on llm-d
vm-manager-test vm-manager as the person, and a VM booted to ready
workspaces-test Workspace storage, Sessions' sub-path mounts and the provider instances
substrate-step-test Conversations and durable volumes across a Substrate release
kagent-step-test Conversations and durable volumes across a kagent step
substrate-tunnel-test gRPC to an HTTP/1.1-only actor failing at once
klaus-gateway-test Swarmgeist through its Slack adapter, the OBO link store
decisions-test klaus-gateway's decisions
beekeeper-decisions-test, beekeeper-central-test, beekeeper-subscriptions-test beekeeper's decisions in Slack, its central resources, resource subscriptions through muster
backstage-test The headless Backstage sign-in and the muster hop with the person's token

Verify a downloaded release

Every release asset agentlab-<os>-<arch> (.exe on Windows) ships next to its Sigstore bundle agentlab-<os>-<arch>.bundle. No checksums file is published: a checksum adds no trust beyond GitHub's own asset digest, while the bundle ties the binary to a CircleCI build of this repository, the same check agentlab self-update runs before it installs anything. Release candidates are signed by the same identity, so the steps below verify them too.

Download the binary and its bundle into one empty directory, then run cosign (v2 or newer) from outside it. Never run the binary before it verified:

mkdir dl && gh release download v0.96.0 --repo giantswarm/agentlab \
  -D dl -p 'agentlab-linux-amd64' -p 'agentlab-linux-amd64.bundle'

cosign verify-blob \
  --bundle dl/agentlab-linux-amd64.bundle \
  --certificate-oidc-issuer https://oidc.circleci.com \
  --certificate-identity-regexp '^https://circleci\.com/api/v2/projects/[a-f0-9-]+/pipeline-definitions/[a-f0-9-]+$' \
  dl/agentlab-linux-amd64

A verified binary prints:

Verified OK

The builds are signed by CircleCI, not by a GitHub workflow: the certificate's identity is a CircleCI pipeline definition and its issuer is https://oidc.circleci.com. Its GitHub workflow repository extension is empty, so --certificate-github-workflow-repository fails on these builds, and no cosign flag pins the source repository. Check it from the bundle: the certificate's source repository URI extension (OID 1.3.6.1.4.1.57264.1.12) must be github.com/giantswarm/agentlab.

jq -r .verificationMaterial.certificate.rawBytes dl/agentlab-linux-amd64.bundle \
  | base64 -d | openssl x509 -inform der -noout -text \
  | grep -A1 '1.3.6.1.4.1.57264.1.12'
            1.3.6.1.4.1.57264.1.12:
                ..github.com/giantswarm/agentlab

A verification that fails exits non-zero and prints Error: with the reason; the binary is not to be used. Pinning another identity (here a GitHub one) fails like this, and the message names the identity the bundle carries:

Error: failed to verify certificate identity: no matching CertificateIdentity found, last error: expected SAN value to match regex "^https://github\.com/giantswarm/", got "https://circleci.com/api/v2/projects/7bdef2bf-7d98-4aca-bf0c-5d3b72cc306b/pipeline-definitions/48087dfd-3bbc-5498-9a9a-f7f1bb77c43d"

A binary that does not match its bundle, or a bundle of another repository's build, fails the same way, either at the identity or with a signature error; a bundle whose source repository is not github.com/giantswarm/agentlab fails the check above.

Documentation

Page What it covers
Getting started Requirements, docker CPU and memory, install, what configure discovers, the first up, connecting Claude Code
Command reference Every agentlab command and flag, the environment variables, keeping the binary current
TLS The lab CA, trust and untrust, Node and browsers, bringing your own certificate
The agent platform muster + mcp-kubernetes: the request path, per-server sign-in, the infrastructure families, toolsets, deviations from a real management cluster, the dev channel (a branch's dev builds), Agent Substrate and the platform Postgres from the chart, Substrate worker nodes (substrateNodes) for node-loss proofs
Agents The kagent runtime, the default ModelConfig and the API key Secret
The migration rehearsal A 3.x lab with the four fleet shapes upgraded in place to the 4.x line: the command sequence, the timings, what the migrate run rewrote, refused and deleted, what an installation's cut-over does differently
Models Extra model configs, model servers on the host, managed models through model-manager, model serving on llm-d in the lab
vm-manager The platform's VM provisioner as a pod of the node: the KVM devices, the image directory, the dev image, the golden PCR recipe, the proof
klaus-gateway Swarmgeist as the meta chart's component: the values, the two lab Secrets, the OBO link store in a Secret across a pod loss, the dev image, what a lab without a Slack workspace cannot prove
Observability Prometheus + mcp-prometheus, and Backstage's metrics views
Backstage The human frontend: the muster plugin, agents and models in the portal, the agent create flow
Identity Users and groups, the shared issuer, the Dex version, wiring another app, trustedPeers
Workspaces The workspace storage switch (the NFS server, the NFS CSI driver behind its mTLS proxy, the read-write-many class, the proof) and the workspace-manager's provider instances, a GitHub App of the lab's own and a GitLab
GitHub sign-in GitHub as a second way into the lab: the App and its callback, the client secret placed as a Secret, what a GitHub user is in the lab
Secret sources Where the lab's real credentials come from: the op://, SOPS and k8s:// references agentlab.yaml records, how up and platform read and place them without the value reaching an argument, a file or the output, place-secret
The lab's registries The lab registry and the gsoci mirror every lab on the machine shares (registryMirror), zot following its releases, holding the lab registry back (zotVersion)
Bandwidth The shaper that lets the mirror's downloads yield to your own traffic (bandwidthShaper): how it decides, the machine's override (agentlab shaper), what it shapes and what not, the namespace proof
Troubleshooting The gotchas that cost time
Usage data The anonymous usage signals — one per command, one per platform install naming the chart line, the lab portal's under the same deployment ID — and how to opt out
Development environment Developing a platform component against the lab: hot reload, dev images, unreleased charts
Development Repository layout, building and testing, the hack journal

Development

make build     # CGO_ENABLED=0 go build -o agentlab .: static, as the lab's containers need it
make test      # go test ./...
make lint      # golangci-lint as CI's pre-commit runs it: its pinned version, linters and config

The lab's end-to-end checks are its own *-test subcommands, not go test. Every hack and workaround, with its status, is recorded in HACKS.md; CLAUDE.md briefs coding agents on the repository. The layout is in Development.

License

Apache 2.0.

About

Run the Giant Swarm agent platform locally: muster + Kubernetes MCP (optionally Backstage) on a throwaway kind cluster, with a bundled Dex as IdP

Resources

Security policy

Stars

25 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages