Running Agent Substrate in production means real object storage for snapshots, a datastore for the control plane that survives a node loss, secrets that are minted per actor at restore, a sandbox class you can defend, and a WorkerPool you scale on demand rather than on CPU. Helm install on kind is a lab. It hides those decisions until they page you.
I have not claimed an EKS production fleet here. I have run the runtime on a laptop cluster, broken restore, wedged DNS, and pinned workers with ghost actors. This is the list I would take to any managed Kubernetes, including EKS, before I called it production. The broader, runtime-agnostic version is running agents in production on Kubernetes.
The density that makes the list worth doing is already measured. Nine agents on two worker pods in the first lab, then 18 on the same two workers, over a thousand real chat sessions, reserved capacity about 4.5x lower than the same agents as always-on pods. Always-on kagent defaults sat at about 204 MiB resident and 50m CPU idle. Nine of those is roughly 1.8 GiB and 450m CPU reserved around the clock. Production is how you keep that ratio without turning the lab shortcuts into outages.
Why do snapshots need a real bucket?
Actors checkpoint memory and disk to object storage. In the lab that was an in-cluster store. In production it is a bucket you already back up, with lifecycle rules, and with restore latency you have measured.
The split I want is: the runtime decides what to snapshot and when a snapshot is committed. The storage plugin moves bytes and owns integrity. If those two jobs sit in the same process, a storage outage becomes a control-plane outage. Agent checkpoint to object storage is the longer version. Suspend and resume agents is the lifecycle.
Do not go live without a restore drill: suspend on one node, resume on another, confirm the session is the same session. Confirm a workspace file the agent wrote. Confirm the snapshot is not sitting on emptyDir. Give atelet put/get on that prefix only. Actors should not hold the bucket credential.
Suspended actors pile up. The actors list grew without bound in my lab: past 900 entries in a day, later through thousands, then partial results under load. Storage will do the same if you never expire. Retention is a product choice. Destroy, keep as a forensic artifact, or expire after a window. Freeze-and-keep only works if the object is still there after you kill the worker.
What datastore does the control plane need?
ateapi in my lab sits on Valkey. That is fine until the node dies mid-restore. Production means a datastore with a failover story you already operate: a managed Redis, or Postgres if that is the path the project is on for your version. I would not invent a new database team for this. I would reuse whatever already holds cluster state.
Back it up on the same schedule as etcd, not on a hope.
Live assignment (which actor is on which worker) lives in ateapi, not in Pod status. Kubernetes only sees WorkerPool and ActorTemplate in ate.dev. If ateapi is wrong, Substrate Scope is wrong, autoscaling is wrong, and you will reset the wrong thing. I read status through the kagent controller:
kubectl port-forward -n kagent svc/kagent-controller 8083:8083
curl -s http://127.0.0.1:8083/api/substrate/status
Use the workers list. The actors list is a graveyard of Suspended rows. kubectl is lying to you if you watch pods. The actors list lies if you join through it.
Two install flags from the lab are load-bearing in any environment, managed or not: pin registry=ghcr.io so golden snapshots can pull, and set platform: substrate on SandboxAgent or the API rejects the spec. I sat in Resuming for 25 minutes on a digest that only existed on ghcr.io. That is a production incident the first time someone copies the docs example.
How should actor secrets work in production?
Pods consume Kubernetes Secrets, CSI drivers, or a cloud secret manager sidecar. Actors come and go across workers. A secret mounted on the worker pod is a secret every actor on that worker can see, including the next one.
I want per-actor credentials, short-lived, issued at restore, gone at suspend. Proof of agent identity is the shape. Restore is the moment to mint. Suspend is the moment to drop. If the actor still holds a cloud key across a checkpoint, you have serialized a secret into object storage.
If the interface you have today is Kubernetes Secrets or one cloud secret manager and not the other, that is a gap to name in the design review, not a surprise after launch. Workload identity federation (projected SA token in, resource-scoped credential out) is the pattern I would rather operate than a long-lived provider key in a Secret.
The worker’s ServiceAccount is the pool, not the agent. Audit logs that say system:serviceaccount:kagent:kagent-default prove a bay, not an actor.
How do you pick a sandbox class and scale the pool?
I run gVisor. It is the class the project gave me, and it is what a held file lock survived inside of. A microVM is a different isolation bar: stronger kernel separation, heavier, and a better fit if the threat model is “untrusted tenant code on a shared node.”
Do not mix them silently in one pool. The WorkerPool’s sandboxClass is a production decision. Write down what it does not stop. Then add sandboxed networking for agents. NetworkPolicy on the worker pod is a backstop, not actor isolation: every actor that lands there shares it. Kubernetes network policy for agents is the composition.
Workers are slot-bound. Active sessions in my cluster idle at single-digit mCPU. A CPU HPA will sleep through a full pool. Scale on rejections and occupancy. I wrote the policy in CPU is the wrong signal to autoscale agents. Substrate rejects when full (substrate worker pool has no free workers) instead of queueing, so the demand signal lives in caller retries until the runtime exports it.
Also write an idle policy. If nothing suspends idle actors and nothing consolidates empty workers, you have a smaller Deployment and you called it a substrate. Size replicas to simultaneous sessions plus a buffer, not to agent count. How many agents per Kubernetes pod.
Autoscaling is not scheduling. When the pool is full, whoever retries first wins. Two teams on one pool need a policy before launch, not after the first fight. Scheduling agent sandboxes. Agent runtimes have an autoscaler, not a scheduler.
One helm trap: kubectl scale takes field ownership of .spec.replicas, so later helm upgrade runs fail with a server-side apply conflict until you add --force-conflicts.
What runbook do you need before the first incident?
Killed sessions have left ghost actors pinning workers while the pool looked idle. Restarting the WorkerPool was cheap because state lived in snapshots, not in the pods:
kubectl rollout restart deploy/kagent-default-deployment -n kagent
Only the wedged sessions die. Every agent’s snapshot survives. Scope has a reset button for the same reason. Production needs that runbook before the first incident, not during it. Ghost actors pin your workers.
In-sandbox egress in my lab died when substrate’s CoreDNS reload failed (plugin/reload: Corefile changed but reload failed). Restart deploy/dns in ate-system. You will misdiagnose this as a model outage if DNS is not on the page.
A checklist I would not skip:
- Restore drill: suspend on node A, resume on node B, same session.
- Datastore failover test for ateapi, on the same schedule as etcd backups.
- Per-actor secret mint at restore, gone at suspend. No long-lived key in the snapshot.
- Sandbox class written down, one class per pool, egress default-deny per actor.
- Scale on occupancy and rejections, floor of more than one worker, idle-suspend policy named.
- Ghost-slot reset path. Watch workers, not actors, not pods.
- Registry pin and
platform: substratein the install runbook.
Managed Kubernetes (EKS, GKE, AKS) offloads the API server. It does not offload any of the above. If a cloud is missing a credential provider or a pod-identity hook the project needs, that is an upstream gap to track, not a reason to fake a green dashboard.
Field guide: Agent Substrate.