Kubernetes (Helm)
Install twins on any Kubernetes cluster with the Helm chart, from a trial to production.
deploy/charts/twins installs twins on any cluster, from a trial to production. It runs the same services as the Docker Compose install.
Runs on
EKS, AKS, GKE Standard and Autopilot, OpenShift, EKS Anywhere, kind, k3s, EKS on Fargate, a cluster of your own
You need
Helm, kubectl, and a storage driver that takes ReadWriteOncePod
Default
Bundled Postgres and Valkey: enough to try. Managed stores and a gateway or ingress with TLS for production.
Watch out
Set networkPolicy.allowFrom. A pod that can reach the server directly can name any address.
Prerequisites
A Kubernetes cluster, Helm and
kubectl.A CSI driver (the block storage of EKS, GKE and AKS have one) or a provisioner that takes
ReadWriteOncePod, as the local-path provisioner of kind and k3s does. See The worlds' volume.A network plugin that enforces NetworkPolicies (Calico, Cilium, GKE Dataplane V2, Azure).
Copy this
A trial install with the bundled stores:
helm install twins deploy/charts/twins -n twins --create-namespace
kubectl -n twins exec statefulset/twins-worlds -- twins enroll --email you@acme.com
kubectl -n twins exec statefulset/twins-worlds -- twins issue --email you@acme.com
helm test twins -n twinsSteps
Install the chart
This runs the twins server with a bundled Postgres and Valkey cache. That is enough to try twins. For production, see Production values.
Make the first key
Sign-in is off by default, so you mint every key on the server. Enroll an address, then issue a key for it:
issue prints the key once. Copy it now. The first address enrolled from a company domain owns that organization. See Keys and limits.
What runs
worlds
StatefulSet and volume
1
The server holds the right to write its worlds alone. A StatefulSet stops the old copy before it starts the new one. Kubernetes restarts it where it fails.
postgres
StatefulSet and volume
1
Bundled to try twins. Turn it off (database.deploy: false) for a managed Postgres.
cache
Deployment
1
Valkey (BSD-3), bundled. Turn it off (redis.deploy: false) for a managed cache that speaks the Redis protocol (ElastiCache, Memorystore, Azure Cache). Keeps nothing on disk.
console
Deployment and PodDisruptionBudget
2
Optional. A person's session is a sealed cookie, so any copy serves it.
Every pod runs as its image's non-root user with a read-only root filesystem, every capability dropped and the runtime's default seccomp profile. That is the Kubernetes "restricted" pod security standard. No pod mounts a Kubernetes API token. The twins server has a service account of its own (serviceAccount) for a cloud identity to be bound to.
Production values
For production, use a managed Postgres and cache, put a gateway or ingress with TLS in front, and turn the console on.
Gateway or ingress
The routes are HTTPRoutes on a Gateway the cluster runs (Envoy Gateway, Istio, GKE's, AKS's application routing). The Gateway holds the certificate.
A Gateway's listener takes routes from its own namespace alone unless it says otherwise: allowedRoutes.namespaces.from is Same by default (Gateway API: cross-namespace routing). With the Gateway in another namespace, its listener must name twins' namespace (from: Selector) or take every namespace (from: All). Then check that the routes were taken:
An agent's MCP stream stays open longer than many gateways wait for an answer. gateway.timeouts sets the route's own (Gateway API: HTTP timeouts), for example {request: 1h, backendRequest: 1h}, or "0s" for none. This is an extended feature, so check that the route stays Accepted.
ingress-nginx, the usual Ingress controller, is retired (Kubernetes, November 2025). ingress still serves an Ingress for a controller that is maintained.
worlds.base is the address every MCP and API URL a world hands out is written against. Left empty, it is https://<ingress.hosts.worlds> when the ingress is on, else the service's in-cluster address, which only the cluster reaches.
Secrets
The chart never takes a secret written into values. You name a Kubernetes secret instead.
Keep each store's password in a secret of its own (passwordSecret), apart from its address. The server reads it from a mounted file on every new connection, so a rotated password reaches it without a restart, and the address shows none. A password inside the address still works.
The chart generates some secrets: the bundled stores' passwords and the console's cookie secret. It makes each one once, keeps it on every upgrade, and leaves it behind on uninstall with the volumes it unlocks.
Certificates of managed stores
The chart checks a managed store's certificate where you give the CA:
database.external.caSecret: a CA such as Cloud SQL's server CA, withsslmode=verify-ca.database.external.systemCA: a certificate from a public CA, such as Azure's, withsslmode=verify-full.redis.external.caSecret: a CA such as Memorystore's, named in the address withssl_ca_certs.
The cloud modules pass these for you.
Images
The chart pins the images it chooses (the bundled Postgres and Valkey) by digest as well as tag. Set image.digest on the twins and console images to pin those too.
values.schema.json refuses a value of the wrong type, outside its choices or under a key the chart does not have (a misspelt one) before anything is installed.
The worlds' volume
worlds.persistence.accessModes is [ReadWriteOncePod]. One pod in the whole cluster mounts the volume, where ReadWriteOnce allows every pod on one node (Kubernetes: access modes).
It needs a CSI driver (the block storage of EKS, GKE and AKS have one) or a provisioner that takes it, as the local-path provisioner of kind and k3s does. Elsewhere the claim stays Pending with an event saying why. Then set worlds.persistence.accessModes: [ReadWriteOnce]. The server's own lock on its worlds still keeps a second copy from writing.
The claim outlives an uninstall (persistentVolumeClaimRetentionPolicy: Retain). worlds.persistence.size sets its size (default 10Gi).
Network policy
NetworkPolicies are on (networkPolicy.enabled). They let the bundled Postgres and cache take connections from the twins server alone.
networkPolicy.allowFrom names who reaches the server and the console: the ingress controller's or gateway's namespace. Empty leaves them open to the whole cluster.
The policies need a network plugin that enforces them (Calico, Cilium, GKE Dataplane V2, Azure). Where a policy closes the server, name your metrics scraper in worlds.metrics.scrapers. See Monitoring.
Replicate worlds to S3
worlds.replication streams every world to an S3 bucket with Litestream as it is written. A server on an empty volume restores them before it serves.
The credentials come from the pod's identity (serviceAccount.annotations) or worlds.extraEnvFrom.
A store that speaks S3 with its conditional writes, such as MinIO or Cloudflare R2, is named by worlds.replication.endpoint. Its bucket is then addressed by path.
Make sure exactly one install writes each bucket and prefix. See Backups.
Special clusters
What the chart refuses
The chart refuses, by name, an install that cannot serve:
The bundled database or cache off, with no secret naming the managed one.
Sessions on with no identity provider, or sessions off with one named. See Your own sign-in.
The gateway on with no Gateway named.
The ingress and the gateway both on.
Replication with no region.
An upgrade that would change a StatefulSet's fixed fields. See Upgrades.
Common problems
The worlds' claim stays Pending, with an event saying why
Set worlds.persistence.accessModes: [ReadWriteOnce]. The server's own lock still keeps a second copy from writing.
An HTTPRoute is not Accepted
With the Gateway in another namespace, its listener must name twins' namespace (from: Selector) or take every namespace (from: All).
An agent's MCP stream stays open longer than the gateway waits
Set gateway.timeouts, for example {request: 1h, backendRequest: 1h}, or "0s" for none.
helm template, Argo CD or Flux make a new secret on every render
Name your own: database.bundled.existingSecret, redis.bundled.existingSecret and console.sessionSecret.name.
The metrics scrape fails and TwinsDown fires
Name your scraper in worlds.metrics.scrapers. See Monitoring.
Next
Upgrades:
helm upgrade, and rolling back.Backups: the volume and the database.
Monitoring: the ServiceMonitor and twins' alerts.
Last updated: 27 October 2026
Was this helpful?