Making Running Optional: Scaling AI Agents on Kubernetes With Agent Substrate
Learn how an early-stage open-source project separates workload lifecycle from compute allocation for bursty, stateful, and massively concurrent AI workloads.
Join the DZone community and get the full member experience.
Join For FreeWhat if you could multiplex roughly 250 stateful agent sessions across eight Kubernetes worker Pods, then reactivate any one without losing its in-memory or filesystem state?
The repository's demo reports 30x+ actor-to-worker oversubscription for that sample workload, with sub-second activation. It is a demonstration, not a production capacity guarantee.
Agent Substrate is interesting not because it makes Kubernetes faster, but because it challenges a common deployment pattern around Kubernetes: coupling a workload's logical lifecycle to the compute allocated to run it. For AI agents that spend most of their time idle while retaining valuable state, separating those lifecycles could become an important building block for operating agents at significantly higher density.
Kubernetes gave us an exceptionally durable abstraction for running workloads: the Pod. But emerging agent workloads expose places where that abstraction may become inefficient. They can be stateful, sandboxed, and overwhelmingly idle. A one-agent-per-Pod deployment model, while simple, couples each session's logical lifecycle to a Pod's runtime lifecycle. When sessions spend much of their time idle, that coupling can leave compute capacity allocated to workloads that are not actively executing.
This is not a claim that Kubernetes is obsolete. It is an exploration of where Kubernetes remains the right substrate--provisioning capacity, managing worker Pods, and enforcing infrastructure policy--and where an agent-specific control plane may need a faster path for high-frequency lifecycle operations.
The Thesis: Make Running Optional
The central idea is surprisingly simple: an agent does not need to occupy compute merely because it exists.
Agent Substrate calls an instance of a managed workload an actor. The deliberately broader term matters: an actor does not have to be an AI agent; it can be any OCI workload that benefits from being bursty, checkpointable, and independently suspendable. The system provides an agent-oriented workload runtime and control plane; it is not an agent framework or SDK.
An actor can be suspended into a snapshot containing process memory, filesystem state, or both. The worker Pod is then freed. When another request arrives, the system restores the actor to a ready worker and routes the request to it.
In this model, the actor becomes the logical workload, while the Pod becomes temporary compute capacity.
That gives the architecture three defining properties:
- Warm capacity replaces per-session capacity. A smaller pool of ready workers serves a much larger population of actors over time.
- State survives worker reassignment. The next activation need not use the worker that ran the actor previously.
- Requests can initiate activation. The router can hold a request while the control plane brings a suspended actor back.
The project's architecture document defines north-star targets including 100 ms p95 activation, one billion active and idle actors per cluster, and 1,000 wakeup events per second. These are architectural targets, not production benchmarks or guarantees. That distinction is important because the repository itself is candid that large parts of the architecture are still evolving.
Architecture at a Glance
The control flow becomes easier to follow once the logical workload is separated from the physical capacity:

Why the Pod Becomes an Awkward Unit for Agents
A conventional one-Pod-per-session deployment model can become inefficient when sessions spend most of their lifetime idle but retain valuable state. Agent-like workloads have a different shape:
- They wait much more than they compute.
- They may execute untrusted code, so multi-tenancy often means one sandbox per session.
- They keep useful state in memory and local filesystem changes.
- Their active periods can be short enough that creating and initializing a dedicated Pod for each session becomes noticeable user-facing latency.
In a one-Pod-per-session design, the logical unit a user cares about — a coding session, sandboxed tool, or stateful agent — does not align cleanly with the physical unit Kubernetes schedules: a Pod.
One straightforward approach is to keep each session's Pod alive. Agent Substrate asks whether that physical allocation can be temporary instead. Its answer is a pool of pre-provisioned worker Pods plus a separate actor record that tracks identity, lifecycle state, placement, and snapshots.
This is an important architectural departure from Kubernetes' conventional control-plane model. Kubernetes intentionally optimizes for declarative desired state and asynchronous reconciliation. Agent Substrate moves high-churn actor state out of the Kubernetes API machinery so that wakeup, placement, and snapshot transitions can occur without making each actor a Kubernetes object. The point is not that Valkey or Redis is universally "faster than etcd." The interesting boundary is low-frequency desired state versus high-frequency runtime state: the two have different frequency and latency profiles, so the system gives them different control paths.
Three Planes of State
The resource model separates declarative configuration from dynamic runtime records. Operationally, snapshot contents form a useful third plane:
| STATE TYPE | WHERE IT LIVES | WHY |
|---|---|---|
ActorTemplate, WorkerPool, and SandboxConfig |
Kubernetes CRDs | Low-frequency infrastructure configuration benefits from Kubernetes RBAC, auditability, and reconciliation. |
| Actors, workers, assignments, lifecycle state, and snapshot references | Control-plane store (Redis/Valkey by default; experimental PostgreSQL support is also available) | These records change on lifecycle transitions and need low-latency reads and writes. |
| Snapshot contents | Node-local storage for Pause; object storage for snapshots committed during Suspend | Snapshot scopes trade off locality, durability, and transfer cost. |
An ActorTemplate defines an actor class: its container image, snapshot behavior, and compatible worker selection. A WorkerPool declares warm Pods. An Actor is a specific instance that moves between workers through its lifetime.
Here is a trimmed ActorTemplate from the repository's multi-template demo:
apiVersion: ate.dev/v1alpha1
kind: ActorTemplate
metadata:
name: counter
spec:
containers:
- name: counter
image: ko://github.com/agent-substrate/substrate/demos/counter
workerSelector:
matchLabels:
workload: multi-template-shared
The important omission is a dedicated Pod. The template describes the workload and selects compatible reusable capacity; a separate WorkerPool provides the warm Pods, while the actor's identity and lifecycle remain independent of whichever worker hosts it.
The deeper architectural pattern is a separation of three related lifecycles: infrastructure, workload, and execution. Kubernetes manages infrastructure capacity; the actor control plane manages logical workload identity, placement, and lifecycle; snapshot and sandbox machinery preserve and reconstitute execution state. Once those lifecycles are separated, a worker Pod becomes a reusable execution slot rather than the identity of the workload itself.
An actor is addressed by (atespace, name), not by name alone. That is more than a naming detail: the glossary defines an atespace as a logical actor isolation boundary, not a replacement for Kubernetes namespaces or a sandbox security boundary. The same actor name can exist in different atespaces. The atespace also appears in the actor's routable DNS name:
<actor-name>.<atespace>.actors.resources.substrate.ate.dev
This is the first place the project begins to look less like a set of Kubernetes objects and more like a runtime: stable logical identity remains while the physical worker assignment changes.
The Request Path: Routing Becomes Placement
The most consequential design choice is that ingress is part of activation.
The networking architecture provides the actor DNS model and an Envoy-based router. The router's ext_proc handler reads the actor reference from the request authority, calls the control plane to ensure that actor is running, and then selects the assigned worker as the upstream.
Error: Parse error on line 22:
...atunnel Ateom->>Actor: Forward over
----------------------^
Expecting '+', '-', '()', 'ACTOR', got 'participant_actor'
The ingress detail matters. The router does not forward directly to the actor's application endpoint. It opens an mTLS connection to the worker's atunnel listener. atunnel validates the router and forwards only to the actor currently assigned to that worker. That makes routing part of the security boundary, not merely service discovery.
There is also a practical admission-control insight here. A saturated worker pool should not turn a burst of requests into an unbounded queue. The router can park a bounded number of requests while it retries transient capacity and control-plane conditions; once the parking limit is reached, it sheds new work.
Activation latency is therefore not just a restore-time problem. It is also a backpressure problem.
What Happens During Suspend and Resume
The control plane coordinates a distributed workflow rather than pretending this is a single atomic operation.
For a resume, it locks the actor, reads its state and template, selects an eligible idle worker, asks the node-level supervisor to restore a snapshot or cold boot, and marks the actor running only after the worker is ready. For a suspend, it checkpoints state, persists the requested snapshot scope, clears the worker assignment, and returns the worker to the pool.
The details reveal deliberate distributed-systems trade-offs. In the default Redis backend, actor and worker records are separate keys that may occupy different cluster slots, so they cannot be updated in one cross-slot action. The implementation uses per-record version checks, actor locking, ordering, retries, and idempotent workflow steps to coordinate these transitions.
The architectural implication is that lifecycle operations are treated as recoverable workflows rather than atomic infrastructure mutations. A repeated lifecycle call can discover completed steps and move forward instead of blindly redoing them.
The Worker Is a Reusable Sandbox, Not the Actor
Below the control plane, atelet runs as a DaemonSet and manages the node-side work: image preparation, OCI bundle assembly, snapshot transfer, and communication with the worker. ateom runs inside the worker Pod and drives the sandbox runtime.
The repository currently defines gVisor and microVM sandbox classes. In the gVisor path, ateom drives runsc checkpoint and restore. Depending on the configured scope, snapshots can preserve process and filesystem state, allowing an actor to resume later on another worker. This is why the demo can show an in-memory counter continuing after a suspend/resume cycle: the application was restored, rather than restarted from scratch.
The security model should be described with care. Sandboxing and mTLS are real implementation elements, and the project has a detailed threat model. But that document explicitly says security hardening remains early. A fair reading is that Agent Substrate is making the right boundaries visible--sandbox, worker reuse, actor identity, snapshot access, and router-to-worker authentication--rather than claiming those boundaries are already production complete.
What the Demos Prove--and What They Do Not
The most accessible proof is the counter demo. A tiny HTTP service increments an in-memory counter. Create an actor in an atespace, send requests through atenet-router, suspend it, and resume it. The counter continues. The demo makes the abstract claim concrete: memory and filesystem state can outlive a worker assignment.
The README's published density demonstration goes further: about 250 stateful actors multiplexed across eight physical worker Pods. The repository also includes examples for Claude Code multiplexing, request parking, autoscaled worker pools, and different templates sharing a worker pool.
These examples validate the model and its developer experience. They do not prove the project's one-billion-actor target, production reliability, or a universal cost model. Treating that distinction honestly makes the architecture more interesting, not less: the open questions are precisely where the difficult engineering begins.
From Traffic Locality to Compute Locality
My previous DZone article, "Zone-Aware Routing in Kubernetes", examined a related infrastructure question: how should a platform place traffic so requests stay local when that improves latency, resilience, or cost?
That work led me to a broader question: if locality matters for packets, what happens when locality also matters for stateful compute?
Zone-aware routing asks where traffic should go. Agent Substrate raises a harder question: where should the compute state itself live when a workload can disappear from one worker and reappear on another? This turns locality from a networking concern into a workload-lifecycle concern.
That change has consequences:
- Scheduling cannot be evaluated only by where free CPU exists; snapshot location and resume cost matter too.
- Routing cannot be evaluated only by endpoint availability; it can trigger a state transition.
- Security cannot stop at the Pod boundary; worker reuse and snapshot access become first-class concerns.
- Autoscaling cannot only count replica demand; it must account for how long actors remain active, parked, or suspended.
- Storage cannot be treated as an afterthought; snapshot placement, transfer time, durability, and locality become part of the activation path.
This suggests a broader infrastructure question for agent workloads. The challenge is not simply running more containers; it is hosting large populations of mostly-idle, stateful, potentially untrusted processes without allocating dedicated compute to each one.
Where the Hard Work Remains
The project is unusually direct about its unfinished work: control-plane performance and reliability, worker autoscaling, identity and policy, actor network isolation, storage design, observability, and support for different sandbox runtimes all remain active areas of development.
Those concerns are not peripheral; they determine whether the architecture can operate reliably at the scale it targets. A system that makes activation fast must still decide how to shard state, restore safely, apply policy before execution, isolate one actor from the state left by another, and reason about locality without turning every wakeup into a storage bottleneck.
Four questions are especially important:
- Snapshot locality. If an actor's state is remote, resume latency becomes partly a storage and network-transfer problem.
- Snapshot correctness. Checkpointing a live process is not equivalent to serializing application state. Open connections, timers, external leases, credentials, and dependencies can make a restored process semantically different from a freshly initialized one.
- Activation bursts. Multiplexing improves average utilization, but a correlated wake-up event can turn many inexpensive idle actors into a sudden demand spike. The system therefore needs admission control and worker autoscaling that respond to activation pressure, not only steady-state utilization.
- Fairness. A small number of highly active actors can monopolize workers unless scheduling and admission control account for competing demand.
Agent Substrate is therefore more compelling as an emerging architectural pattern than as a product claim. Its value is in making these trade-offs explicit and providing a runnable implementation that exposes where the abstractions are strong and where they remain unfinished.
Conclusion
The Pod is unlikely to disappear. But it may stop being the only unit we think about when we build infrastructure for agents.
Kubernetes remains a powerful system for provisioning and operating compute. Agent Substrate is exploring what happens when the logical lifecycle of an agent is separated from the lifecycle of the Pod that temporarily runs it.
If agents become ubiquitous--long-lived, intermittently active, stateful, and capable of executing untrusted code--the infrastructure challenge will not simply be running more Pods. It will be deciding where an agent should exist when it is inactive, how quickly it can become active, and how efficiently thousands or millions of them can share the same underlying compute.
That is the problem Agent Substrate is attempting to solve.
At a billion actors, the central question is no longer how to run more agents.
It is how to make running optional.
Further Reading
Agent Substrate is Apache-2.0 licensed, explicitly not an officially supported Google product, and in active early development. The architectural analysis and opinions in this article are my own.
Opinions expressed by DZone contributors are their own.
Comments