01 · Know the cluster
Three zones, all spot.
The cluster-state scan records how many availability zones each cluster spans and whether it has spot nodes. It also records whether the cluster runs only on spot. It reads node labels and nothing else.
Here: three zones, four spot nodes. checkout-api runs
two replicas, but both landed on the same node.
payments-operator and orders-worker run a
single replica each, on that same node.
02 · The node gets taken back
One preemption, three outages.
The provider reclaims node a-1 with a few seconds of
notice. Everything on it stops at once.
checkout-api had two replicas and still went fully
dark. Replicas that share a node share its fate. Until the scheduler
finds room and the new pods pass their readiness checks, nothing
serves checkout.
03 · Find the weak spots, before it happens
The rule pack reads the manifests that allowed it.
The same gaps are visible in git long before any node dies. The
availability rules walk every workload daily and check it against
the cluster it runs on:
- multi-replica, but nothing spreads the replicas over nodes and zones,
- multi-replica, but no PodDisruptionBudget,
- a controller-manager running as a single replica,
- a grace period longer than spot allows.
04 · No model in the loop
Deterministic rules, not a guess.
This agent does not call an AI model at all. Each rule is a plain check with a fixed fix. So you can reproduce a finding and explain it line by line. The pack also costs nothing to run every day.
A rule that needs topology skips itself when the zone count is unknown, rather than guess. When the assistant cannot write a clean diff, the finding becomes an issue instead of a risky MR.
05 · Spread the replicas
One replica per node, one per zone where possible.
On a multi-zone cluster, a multi-replica workload without
topologySpreadConstraints (Kubernetes rules that spread pods apart) gets two constraints. One uses the node as key and one uses the zone. Each has maxSkew: 1 and the
workload's own selector labels.
Both are ScheduleAnyway, a best-effort spread that can never leave a pod Pending when capacity is short. You can tighten it
to DoNotSchedule if you have guaranteed room.
06 · Budget the disruptions
Drains and upgrades take one pod at a time.
A multi-replica workload with no PodDisruptionBudget (PDB, a limit on how many pods can stop at once) gets one. The assistant adds it in a new file next to the workload and wires it into the directory's kustomization.
Be clear about what that buys: a PDB governs only voluntary
evictions, such as node drains, pool upgrades and autoscaler
scale-downs. A spot preemption does not ask permission. That is
what the spread in step 05 is for. The two cover different failures,
so you get both.
07 · Controllers and grace periods
Leader-elected controllers get standbys. Grace fits spot.
A controller-manager running alone gets a proposal for 3
replicas. Leader election means only one replica works at a time. The others take over when the leader's node dies. It ships as a "judgment call" draft. The assistant skips it for controllers whose standbys cannot pass readiness.
On a spot-only cluster, a terminationGracePeriodSeconds
above 30 is trimmed to 30. Spot never waits longer, and a long grace
also slows every voluntary drain. Trimming further, to 15 s when
every live pod is provably on spot, is
In development.
08 · The same preemption, after merge
Node a-1 goes. Checkout keeps serving.
With the replicas spread, losing a-1 costs one
checkout-api replica, not the service. The operator's
standby in another zone takes the lease. The cluster reschedules the lost pods in the background.
orders-worker still has one replica, so it still
blips. Proposing extra replicas for ordinary single-replica apps,
with evidence that the app tolerates it, is
Roadmap: some singletons are singletons
on purpose.