Fleet and host-cluster sizing
A default install fits a handful of clusters. This page says when it stops fitting, what to raise, and how large the GKE cluster that hosts it has to be. Every figure is labelled one of three ways:
- declared: what the chart and the operator render today, read from
charts/kube-agents/values.yamlandcharts/kube-agents/files/footprint.yaml; - measured: observed on one production fleet of 29 clusters and 44,224 nodes, where the defaults gave broker restarts, disk-pressure evictions and audit sweeps that failed their gate;
- modeled: derived from those two, or from public list prices. A modeled figure is a starting point to measure against on your own install.
The tier is the largest row any metric lands in. The thresholds are modeled: the fleet
column is where the measured fleet sat, and the medium band is where the defaults start to
need the raises below.
| Metric | small (chart default) |
medium |
fleet |
|---|---|---|---|
| Registered clusters | under 10 | 10 to 24 | 25 or more (to 2,500) |
| Fleet nodes | under 1,000 | 1,000 to 14,999 | 15,000 or more (to 250,000) |
| Fleet controllers (Deployments, StatefulSets, DaemonSets, CronJobs) | under 500 | 500 to 2,999 | 3,000 or more |
| Fleet pods | under 5,000 | 5,000 to 29,999 | 30,000 or more |
| Pods in the largest single cluster | under 2,500 | 2,500 to 7,499 | 7,500 or more |
| Objects in the host cluster | under 15,000 | 15,000 to 49,999 | 50,000 or more |
(charts/kube-agents/values.yaml defaults an omitted sizingProfile to small; install.sh and upgrade.sh default PLATFORM_AGENT_SIZING_PROFILE, and Terraform defaults platform_agent_sizing_profile, to auto, which begins at small below 10 clusters and steps up automatically at the 10- and 25-cluster thresholds above.)
The host-cluster row is the one that sizes the operator. The manager caches every Deployment, StatefulSet, Service, ConfigMap, ServiceAccount, PersistentVolumeClaim, NetworkPolicy, PodDisruptionBudget and RBAC object in the cluster it runs in. Those informers take about 3.7 MiB of live heap per 1,000 objects across a balanced mix, and 7.9 to 8.5 MiB per 1,000 StatefulSets or Deployments; see Manager cache and memory sizing. A shared host cluster with tens of thousands of them therefore needs the operator memory raise even at a small fleet. The other rows size the credential proxy, the event watcher and the data volumes, which grow with what the agent reads.
What each pod needs
Section titled “What each pod needs”The table is the component stack without the A2A stack, with the GitHub minter on, the web
console off and Hindsight off. The default column is declared. The fleet column is what
values-fleet.yaml sets, plus the one field it cannot, and is modeled.
CPU is in vCPU, memory in GiB, and each cell reads requests then limits. A test derives the
declared column from the two files and fails when the page falls behind them.
| Workload | Pods | Runtime | Default (declared) | Fleet (modeled) | Ephemeral (declared) | Persistent |
|---|---|---|---|---|---|---|
| Credential proxy (Envoy and the broker) | 1 | standard | 0.5 / 1 then 2 / 2 | 4 / 8 then 8 / 8 | 8 GiB, request and limit | none |
Gateway pod: agent, dashboard, log sidecar, agent-api-auth |
1 | gVisor under the installer default runtimeClassName |
1.506 / 5 then 5.5 / 12.25 | 1.9 / 8.6 then 5.5 / 18.25 | 3 GiB (the two sidecars) | data claim 50 GiB default, 100 GiB fleet; 4 GiB metadata |
Shell sandbox <name>-shell-0 |
1 | node default; its own shellSandbox.runtimeClassName opts into gVisor |
0.2 / 0.5 then 2 / 2 | unchanged; its own resources field raises it |
none declared | data claim follows the gateway’s; 4 GiB for sshd |
| Kubernetes API proxy | 2 | standard | 0.1 / 0.5 then 1 / 1, each | unchanged | none declared | none |
| Operator | 1 | standard | 0.1 / 0.25 then 0.5 / 0.5 | 0.25 / 1 then 0.5 / 1 | none declared | none |
| LiteLLM | 2 | standard | 0.1 / 2 then 0.5 / 3, each | unchanged | 1.25 GiB each | none |
| GitHub token minter | 2 | standard | 0.05 / 0.0625 then 0.5 / 0.25, each | unchanged | none declared | none |
| Total | 10 | 2.806 / 11.875 then 14 / 25.25 | 6.8 / 23.25 then 20 / 37.75 | 13.5 GiB | 228 GiB default, 328 GiB fleet |
On GKE Autopilot the operator renders the credential proxy’s requests at 2 vCPU and 2 GiB instead of 0.5 and 1, because Autopilot without bursting clamps a container’s limits to its requests. The default total there is 1.5 vCPU and 1 GiB higher than the table’s; the fleet column sets the pair itself and is the same on both cluster types.
The gateway pod’s fleet row raises two containers. agent-api-auth is the example’s
agentAPIAuth.resources, 0.5 vCPU and 2 GiB requests with a 4 GiB memory limit. The agent
container is the CR’s spec.deployment.resources, which the chart has no value for; the row
models it at 1 vCPU and 6 GiB requests and 3 vCPU and 12 GiB limits. That field replaces the
operator’s defaults (1 vCPU and 4 GiB requests, 3 vCPU and 8 GiB limits) as a whole block, so
set every key you want to keep. Set it on the CR with kubectl edit; a later helm upgrade
leaves it alone, because Helm patches only the fields its render changes. The
CRD page describes the field.
The memory request is also the dispatcher’s admission budget, so the row’s 6 GiB admits workers
up to about 6 GiB of container memory
(tuning.admission). Setting a
request below workerRssCapMiB (1536 MiB) without raising admission.memoryBudgetMiB or
lowering admission.workerRssCapMiB puts one worker’s cap above the pod’s budget and is refused
where the validating webhook is enabled or flagged Degraded.
The shell sandbox’s 2 vCPU and 2 GiB limits are the operator’s defaults.
shellSandbox.resources raises them one
key at a time. The sandbox runs on the node’s default runtime unless
spec.harness.experimental.shellSandbox.runtimeClassName
names gvisor; the gateway pod’s class is the separate availability.runtimeClassName, which
the installer sets.
maxInProgress counts kanban workers, not the memory of one command. A single
kubectl get … -A -o json of a cluster of 100,000 Pods holds about 14 GiB.
The sandbox’s memory guard acts at its limit less the larger of 256 MiB and an eighth of the limit
(at most a quarter). It stops the largest commands of at least 64 MiB, as many as bring it back
under that mark. Those commands fail, and the sandbox and its other sessions stay up. Each stop is a
JSON line with the program and its size in the sandbox’s log
(kubectl -n kubeagents-system logs <name>-shell-0). A read that large fails at any limit below its
size; narrow it to a namespace or a batch of clusters.
Many small commands are bounded by the kubectl admission instead. Its limits come from the
sandbox’s memory limit: at the default 2 GiB, 13 kubectl reads run at once and 13 more may wait
(fewer under gVisor). A read that finds both full fails at once with a capacity: reason.
The shell’s kubectl admission, and the credential broker’s for the kubectl it runs for profile workers, refuses such a read before it starts, with a reason that names a
narrower read, when its measured cost does not fit. Costs are measured per fleet size: on a fleet
whose clusters hold tens of thousands of Pods, set KUBEAGENTS_KUBECTL_COST_TIER=fleet in
the chart value platformAgent.deployment.env; Applying it shows the install.env line that carries such an entry. A hand edit of the CR’s spec.deployment.env can be lost at the next chart apply.
The tier applies to every cluster the install reads, so on a fleet that mixes large and small clusters a small cluster’s fleet-wide read is charged the large figure and refused. Unset, the default tier charges the small-fleet figures and lets the memory guard stop what does not fit.
The operator passes the tier to the shell sandbox and, under the session cluster view, to the
session Pods the A2A gateway starts. On the default tier at the default session memory limit
(2 GiB), their kubectl runs with no admission. On the fleet tier at that limit, a session Pod
runs the admission against its own memory limit. It refuses a cluster-wide list that the fleet
figures charge above what one read may take there, such as kubectl get pods -A, whatever the
cluster’s real size, as the shell does. Raise the session Pods’ limit with
harness.tuning.sessionResources.limits.memory,
or read per namespace or with a selector. A session Pod never refuses a read for being busy; it
waits, then runs.
Two more stacks add to the total:
-
Hindsight memory (
platformAgent.harness.memory.provider: kube_agents_memory): the API at 0.5 vCPU and 2 GiB requests, 4 vCPU and 4 GiB limits; Postgres at 0.25 vCPU and 256 MiB requests, 1 vCPU and 1 GiB limits, 1.1 GiB ephemeral and an 8 GiB claim. Declared. -
The A2A stack, on every install: its standing pods, a container in the agent pod and a JetStream claim per NATS server. Each delegation adds a session pod, up to
maxSessionsat once. The prerequisites page’s Footprint gives the totals and each pod’s requests and limits, generated from the chart. The totals include the session pods at the cap, and say how much of each is theirs;maxSessionsscales that share, so a host or quota budget follows it.Each NATS server’s metrics exporter is sized for up to about 2,000 JetStream consumers, which is about 1,000 clusters at two consumers per AgentProfile. Its memory and CPU grow with the consumer count, and past that it nears its 192 MiB limit. The same ceiling holds on an Autopilot cluster without Pod bursting, where the limits become the 50m and 96 MiB requests: there, CPU runs out first, and past about 2,500 consumers a scrape outlasts the interval.
The host cluster
Section titled “The host cluster”Option A: GKE Autopilot
Section titled “Option A: GKE Autopilot”Autopilot is the installer’s default CLUSTER_MODE and the recommended shape: it bills the
requests, sizes nodes to fit, and ships the gVisor RuntimeClass. Three rules change what the
table above means there:
- Limits equal requests on a cluster without bursting. The proxy runs at 4 vCPU, the
agent-api-authsidecar at 2 GiB (its watcher reads a 1 GiB soft limit), and every container whose limit is above its request runs at the request. A cluster with bursting admits the manifest as rendered, so the example sets the requests it means to run at. - 1 to 6.5 GiB of memory per vCPU on the requests pair, and, without bursting, per-pod minimums of 250m CPU and 512 MiB. A pair outside the band has its smaller request raised, and the chart’s quota preflight, which sums the declared figures, under-counts by the difference. Every pair in the example is in the band.
- Ephemeral storage up to 10 GiB per pod in the general-purpose class. The credential
proxy’s 8 GiB is the largest declared; raising
limits.ephemeral-storagepast 10 GiB leaves the pod unschedulable.
Billed capacity for the fleet column is about 7 vCPU and 23 GiB, plus 328 GiB of pd-balanced
(modeled, without bursting). At us-central1 list prices that is about $400 to $500 a month
including the cluster fee; modeled, so check the pricing calculator against your region.
Option B: GKE Standard
Section titled “Option B: GKE Standard”The composition creates a default pool of e2-standard-4 nodes, one per zone, and with gVisor
on a gvisor-pool of e2-standard-4, one per zone autoscaling to two, carrying GKE’s sandbox
taint. The module’s
sizing inputs
resize both: sizing_profile = "fleet" renders the table’s machine types and boot disks, and
an explicit input such as gvisor_machine_type = "n2-standard-8" wins over the profile. The
default pool keeps standard_node_count nodes per zone and does not autoscale.
install.sh writes none of the explicit standard_* or gvisor_* inputs. On a fresh
Standard install with 25 or more visible clusters and auto or fleet runtime sizing, it sets or
offers TF_VAR_sizing_profile=fleet when TF_VAR_sizing_profile and TF_VAR_standard_machine_type
are unset. It also keeps an exported TF_VAR_sizing_profile. Set other explicit inputs as
TF_VAR_ lines in install.env and
keep the lines there for every later run. A lost profile line resolves the small profile, and a
lost explicit line the profile’s shape.
The composition’s lifecycle.sh refuses an apply that
would resize a pool unless a sizing input asks for it: the pool’s own input, or a changed profile
for an attribute the profile decided at the last apply. A changed profile asks nothing about an
attribute an explicit line set, so that line stays beside it. A machine type changed outside Terraform shows as drift on the next plan, so change it
through the inputs, or add pools beside the managed ones.
Resize or add them before applying the example. An e2-standard-4 node has under 4 vCPU allocatable once
the system DaemonSets take theirs, so the example’s 4 vCPU proxy request fits on none of them.
On default and fixed profiles ("", small, medium, fleet), the proxy Deployment recreates its pod (Recreate) and leaves the new proxy pod Pending until a node fits.
Under spec.deployment.sizingProfile: auto, the cluster-count floor sets medium at 10 clusters and fleet at 25. It also promotes or steps down proactively from live pod and broker metrics with no human in the loop. Under auto in-cluster, the proxy Deployment rolls with active-standby RollingUpdate (maxSurge: 1, maxUnavailable: 0): if the new surge pod stays Pending, the existing active broker pod keeps serving. Only a fresh install with no running pod stays unavailable until a node fits.
Before each tier transition, the operator checks
the namespace’s ResourceQuota (including the broker’s surge pod) and LimitRange bounds, not node
allocatable capacity. It rolls back a Pending surge pod past two minutes with SizingCappedByQuota (SurgeUnschedulable) while keeping the running pod active. A Standard pool still needs nodes that fit the fleet row’s 4 vCPU proxy
request (e2-standard-8 or larger) before load or count reaches fleet (medium’s 1 vCPU request fits an e2-standard-4). A LimitRange whose max, per container or per pod, is below a row’s figure holds
the tier at the row it admits, and the CR’s SizingCappedByQuota condition names it.
| Pool | Shape (modeled) | Carries |
|---|---|---|
| Default | 3 × n2-standard-8 (or c3-standard-8), 200 GB pd-balanced boot disk, autoscale 2 to 4 |
proxy, operator, LiteLLM, minter, the A2A stack |
| gVisor (sandbox) | 1 × n2-standard-4 from the profile, 150 GB boot disk, autoscale 1 to 2; the A2A gateway pod needs n2-standard-8, so set gvisor_machine_type to it |
gateway pod; the shell sandbox once its own runtimeClassName is set |
Create the gVisor pool with --sandbox type=gvisor, so it carries the taint only the sandboxed
pods tolerate. The boot disk sizes are modeled: the measured fleet’s evictions were disk
pressure, and the pod table’s ephemeral figures plus the node’s images have to fit under the
eviction threshold with room left. About $900 to $1,100 a month on demand at us-central1 list
prices, modeled.
The data volume
Section titled “The data volume”The agent’s <name>-data claim holds every profile’s session store, and each Cluster Agent
profile is one cluster in scope. Under the default 90-day session retention a store keeps
growing well past the period: SQLite reuses the pages a prune frees only partly, so the file
settles at a multiple of its live data. These settled sizes are modeled. They come from a
simulation against the session store (hack/session_retention_sim.py), with inputs measured
on a dev fleet:
| Profile | 90-day retention | 7-day retention |
|---|---|---|
| A Cluster Agent profile (10 cards a day, about 25 KB each) | 291 MiB | 18.6 MiB |
| The Platform Agent’s own profile (18 cards a day, 220 KB each) | 3.47 GiB | not settled by day 300 |
At the 50Gi default the claim fills at about 163 Cluster Agent profiles, beside the
Platform Agent’s own store. Set
platformAgent.storage.expectedClusterProfiles (CR: spec.storage.expectedClusterProfiles)
to the number of clusters you expect in scope, and the operator sizes the agent’s claim to at
least:
8Gi + expectedClusterProfiles x 400Mi, rounded up to whole GiBThat is the Platform Agent’s stores plus 25% for the base, and each Cluster Agent profile’s
ceiling (its live sessions at four times their size) plus Hermes’ log cap per profile. The
claim takes the larger of the formula and platformAgent.storage.size, or the 50Gi default,
so the count only raises it. The formula passes 50Gi above 107 profiles, so an install
of more than about 100 clusters on the default should set it. For example, 200 profiles is
87Gi and 2,500 is 985Gi.
Raising the count later expands the existing claim online where its StorageClass allows
expansion. standard-rwo and standard do on GKE. Where a class doesn’t, the
DataVolumeNotExpanded condition says so, and the claim keeps its size. The shell sandbox’s
claim holds no session stores and stays at size or the default. A namespace
requests.storage quota counts the raised agent claim, and the chart’s quota preflight
counts it the same way.
The fleet values file
Section titled “The fleet values file”charts/kube-agents/examples/values-fleet.yaml
sets what the chart exposes for the fleet tier, each key with its reason and its Autopilot
caveat beside it:
operator.resources: 1 GiB memory, request and limit alike, for a host cluster at or past 50,000 watched objects (or 180 MiB of cached live heap under the per-kind formula in Manager cache and memory sizing). The chart’s floor on the limit is 512 MiB.platformAgent.storage.size: 100Gi: both data claims. A claim cannot shrink, and each GiB counts twice against a namespacerequests.storagequota. For a fleet of more than about 230 clusters, also setplatformAgent.storage.expectedClusterProfiles(The data volume), which raises the agent’s claim alone.platformAgent.harness.tuning.maxInProgress: 3: kanban workers at once, board-wide.platformAgent.deployment.credentialProxy.resources: 4 vCPU and 8 GiB requests, 8 vCPU and 8 GiB limits. Becausevalues-fleet.yamlleavessizingProfileunset (small) and fixed profiles keep the eight-slot default cap,2 GiB -> 8 GiBadds about1 GiBof headroom per command (modeled). SetsizingProfiletoautoto scale both resources and the slot cap (8small,12medium,16fleet).platformAgent.deployment.agentAPIAuth.resources: 0.5 vCPU and 2 GiB requests, a 4 GiB memory limit,limits.cpuleft at its default because the watcher’sGOMAXPROCSfollows it.platformAgent.deployment.env:KUBEAGENTS_AUDIT_AUTO_PROMOTE=false, which keeps the fleet audits from opening remediation pull requests on their own. The window that folds a workload’s later events into one incident is an hour on every install and is not in the file: anenventry for it would overrideplatformAgent.deployment.incidentWorkloadDedupSeconds, the key that turns it off.
The operator copies platformAgent.deployment.env onto the agent container only for names on
its allowlist. It forwards KUBEAGENTS_AUDIT_AUTO_PROMOTE and KUBEAGENTS_KUBECTL_COST_TIER to
the shell sandbox, where the audits run. KUBEAGENTS_KUBECTL_COST_TIER also goes to the A2A gateway
for its session Pods and to the credential broker’s stateful and exec tiers. Literal proxy entries (HTTP_PROXY, HTTPS_PROXY, NO_PROXY, and lowercase forms; valueFrom
entries are ignored) also forward to <name>-a2a-gateway (Guarantee and
limitation). Every name the operator
does not reserve passes to the credential proxy and agent-api-auth containers. The name in the example reaches the container
that reads it.
A process tunable such as MALLOC_ARENA_MAX is not on the agent container’s allowlist. A values
file that sets it renders credential proxy and agent-api-auth containers that carry it, and an
agent container that does not. In those two containers it reaches the container’s own process,
and not the gcloud and kubectl commands. The credential proxy passes a fixed list of names
from its environment to the commands it runs, and this name is not on the list.
CLOUDSDK_CORE_DISABLE_FILE_LOGGING is not on it either, so setting it has no effect on
gcloud. The example leaves both out. The
chart README
has the chart-side detail.
Applying it
Section titled “Applying it”A hand-run helm upgrade applies no CRDs, and spec.storage, spec.deployment.credentialProxy
and spec.deployment.agentAPIAuth need a CRD that declares them, so apply crds/ first; the
upgrade modes say which upgrade.sh runs do that
for you. On Standard, add a pool that fits the proxy’s 4 vCPU request before this
(Option B).
kubectl apply --server-side -f charts/kube-agents/crds/helm upgrade kube-agents ./charts/kube-agents -n kubeagents-system \ --reset-then-reuse-values \ -f charts/kube-agents/examples/values-fleet.yamlAn install made with install.sh and upgrade.sh defaults PLATFORM_AGENT_SIZING_PROFILE to
auto (spec.deployment.sizingProfile: auto), which promotes runtime pod sizes at 10 and 25
clusters when namespace quota allows. Both install.sh and upgrade.sh (--plan, full,
harness, and operator, though --upgrade-mode=operator refuses --sizing-profile and leaves
chart values unchanged) scan visible clusters in scope and print host and storage guidance
before applying. On a fresh Standard install with 25 or more clusters and auto or fleet
runtime sizing, install.sh sets or offers TF_VAR_sizing_profile=fleet when
TF_VAR_sizing_profile and TF_VAR_standard_machine_type are unset. On an existing cluster, add
large nodes deliberately
because resizing a managed Standard pool replaces its nodes.
A hand-edited value passed only by helm upgrade is overwritten on the next full run of
upgrade, so keep explicit overrides in install.env. Put
the profile and volume size in install.env and the remaining overrides in TF_VAR_extra_helm_values,
which the quickstart describes. (sizingProfile: fleet sets the credentialProxy, agentAPIAuth, and shellSandbox presets; leave those blocks out of TF_VAR_extra_helm_values unless intentionally pinning a different limit.) The file holds one
such line and a second platformAgent key replaces the first, so merge these keys into a line
that already has one rather than pasting over it:
PLATFORM_AGENT_SIZING_PROFILE=fleetPLATFORM_AGENT_STORAGE_SIZE=100GiTF_VAR_extra_helm_values='{operator={resources={requests={cpu="250m",memory="1Gi"},limits={cpu="500m",memory="1Gi"}}},platformAgent={harness={tuning={maxInProgress=3}},deployment={env=[{name="KUBEAGENTS_AUDIT_AUTO_PROMOTE",value="false"}]}}}'Read the result on the CR and the pods:
kubectl get platformagent platform-agent -n kubeagents-system \ -o jsonpath='{.spec.storage}{"\n"}{.spec.deployment.sizingProfile}{"\n"}{.spec.deployment.credentialProxy}{"\n"}{.status.effectiveSizingTier}{"\n"}{.status.conditions}{"\n"}'kubectl get pods -n kubeagents-system -o custom-columns='NAME:.metadata.name,REQ:.spec.containers[*].resources.requests,LIM:.spec.containers[*].resources.limits'A Degraded condition with reason InvalidCredentialProxyResources or
InvalidAgentAPIAuthResources means the operator refused an override and rendered that
container at the sizing profile’s row. InvalidKanbanAdmission means the resolved
memoryBudgetMiB is below workerRssCapMiB, so a single worker’s RSS cap exceeds
the pod’s admission budget. DataVolumeNotExpanded means the StorageClass does
not expand claims online. On Autopilot the pod’s limits read equal to its requests
where bursting is off,
which is the cluster rewriting the manifest rather than the chart dropping a key.