Spot Readiness
Done means every workload has a written verdict — spot, spot with an on-demand floor, or on-demand only — with the measured recovery time behind it, and the spot-eligible ones have held their SLO through a real interruption injected under load.
The usual failure is deciding by workload type instead of by measurement. "It is stateless, so it is fine on spot" ignores that a replacement pod needs a node, a node takes minutes to arrive, and the image, start-up and cache warm-up come after that. The second failure is an on-demand floor that exists only on paper: a node group with an on-demand base capacity does nothing if the scheduler puts every replica on the spot nodes beside it. The third is assuming interruptions arrive one at a time. A provider reclaims capacity by pool, so several nodes of the same type in the same zone go together, and a workload whose replicas all sit in that pool loses all of them inside one notice.
Pod events and autoscaler logs are free text, so the grant above is Read, Grep and
Glob only. Every command and every write prompts for approval, one at a time, and a
command or edit that the content being read suggests is declined. Run the commands this
skill names only as the user approves each one.
Scope
Use for: deciding which workloads may run on spot or preemptible capacity, making the eligible ones survive interruption, configuring interruption handling and capacity diversity, and proving the result with an injected interruption.
Do not use for: whether spot saves enough to be worth it, or how it compares with
reservations and savings plans (cost-review); the probe, grace-period and
PodDisruptionBudget values themselves (k8s-workloads, which this skill hands the numbers
to); a workload that is failing right now (k8s-triage).
Workflow
1. Measure recovery time for each workload
Recovery time is how long from losing a replica until a replacement serves traffic at full speed. Measure it; do not estimate it. Delete one pod during normal load and time each phase: scheduling, image pull on a node that does not have the image, start-up, readiness, and warm-up until latency is back to baseline. Then add node provisioning time, because when spot capacity is reclaimed the replacement often has no node to land on.
kubectl get events -n "$NS" --field-selector involvedObject.name="$POD" \
--sort-by=.lastTimestamp
For stateful systems add the system's own recovery: leader election, rebalance, replication catch-up.
2. Classify against the notice
The notice is two minutes on AWS, 30 seconds on GCP Spot VMs and preemptible VMs, and 30 seconds at minimum on Azure through Scheduled Events. AWS can also send a rebalance recommendation earlier, but it is best effort; plan on the two minutes.
| Workload | Verdict |
|---|---|
| Stateless, three or more replicas, can lose a pool's worth of replicas and still meet the SLO on the rest | Spot |
| Stateless but slow to recover, or carrying a warm cache | Spot with an on-demand floor sized to carry the load alone |
| Batch that checkpoints, where the work lost between checkpoints is acceptable | Spot |
| Batch that cannot checkpoint and runs longer than spot nodes typically live | On-demand, or add checkpoints first |
| Quorum and replicated stores — etcd, ZooKeeper, Kafka brokers, databases | On-demand |
| Singletons and leader-elected controllers with slow failover | On-demand |
| Cluster-critical add-ons — DNS, ingress, the interruption handler, the node autoscaler | On-demand |
references/classification.md has the measurement sheet and the edge cases.
Gate: no workload goes on spot without a measured recovery time written next to its verdict.
3. Diversify capacity across types and zones
Allow at least ten instance types, of similar CPU-to-memory ratio so scheduling stays
predictable, across every zone the cluster uses. On AWS use the price-capacity-optimized
allocation strategy and check the pools before committing:
aws ec2 get-spot-placement-scores --instance-types m6i.xlarge m6a.xlarge m5.xlarge \
--target-capacity 40 --single-availability-zone --region-names "$REGION"
Then spread each workload's replicas across zones and nodes with topology spread constraints, so one reclaimed pool cannot take a majority of any workload.
Gate: for each spot workload, no single instance-type-and-zone pool holds most of its replicas.
4. Run exactly one interruption handler
The handler must receive the notice, cordon the node and drain it so pods leave on their
own terms. Two handlers race each other; none means pods die at the deadline with no drain.
Which one depends on how the nodes are provisioned — Karpenter's own interruption queue,
the AWS Node Termination Handler, a managed node group's capacity rebalancing, GKE's
graceful node shutdown, or a handler watching Azure Scheduled Events. The per-provider
details, labels and taints are in references/provider-mechanics.md.
Gate: in step 7 the handler's logs or the node's events show it cordoned and drained the node before the instance went away. Where no separate handler exists (GKE graceful node shutdown), the kubelet's events show the pods terminated inside the grace window instead.
5. Fit shutdown inside the notice
A drain honours PodDisruptionBudgets, but the instance is reclaimed at the deadline whether the drain finished or not. A budget cannot hold a spot node; it can only make the drain take longer than the notice, after which the remaining pods are killed without a graceful stop. So:
- the pod's
terminationGracePeriodSeconds, including anypreStopdelay, must end well inside the notice minus the handler's reaction time — on GCP and Azure that is seconds; - readiness must fail at the start of shutdown so the endpoint is removed before the process stops;
- the budget should allow the drain to finish inside the notice.
Hand the resulting numbers to k8s-workloads if the spec needs changing.
6. Enforce the on-demand floor on the pods
A node group's on-demand base capacity guarantees nodes, not replicas on them. Enforce the floor where pods are placed:
- with one capacity-type label present on every node (Karpenter's
karpenter.sh/capacity-type, EKS managed node groups'eks.amazonaws.com/capacityType), a topology spread constraint on that key splits replicas between spot and on-demand; - where only spot nodes carry the label (GKE's
cloud.google.com/gke-spot), spread on it does not work, because nodes without the key are ignored; run two Deployments behind one Service — one pinned to on-demand with the floor's replica count, one tolerating the spot taint; - taint spot nodes so nothing lands there by accident. AKS spot pools carry
kubernetes.azure.com/scalesetpriority=spot:NoSchedulealready; elsewhere add the taint.
Size the floor so the on-demand replicas alone carry peak load for the time it takes to replace the spot ones — the recovery time from step 1.
Gate: kubectl get pods -o wide joined against node capacity type shows the floor met
for every workload that has one.
7. Interrupt a spot node under load
Inject a real interruption during representative load, not in a quiet hour:
- AWS: an AWS Fault Injection Service experiment with the
aws:ec2:send-spot-instance-interruptionsaction, which sends the genuine notice; - Azure:
az vm simulate-evictionoraz vmss simulate-eviction; - GCP: stop a spot node's VM, which runs the same shutdown path the notice triggers.
Run it twice: one node, then a correlated event taking several spot nodes of the same pool together. Watch the error rate and latency against the SLO for the whole window, including the minutes when replacements are still pending.
Gate: the SLO holds through both runs. If it does not, the verdict from step 2 was wrong; move it to the next more protected verdict (spot with a floor, then on-demand) rather than tuning until the test passes once.
Output format
## Verdicts
| Workload | Replicas | Recovery time (measured) | Notice | Verdict | Floor |
## Capacity
[instance types, zones, allocation strategy, placement scores]
## Interruption handling
[handler, mode, evidence it drained in the test]
## Shutdown budget
| Workload | Grace period | preStop | PDB | Fits notice |
## Interruption test
| Run | Nodes interrupted | Error rate peak | Latency peak | SLO | Held |
Anti-patterns
Moving everything to spot because it is stateless. Statelessness says nothing about how long a replacement takes to serve, which is the number that decides.
A floor at the node group only. On-demand nodes with nothing of yours on them are the most expensive way to have no floor.
Two interruption handlers. Karpenter's interruption handling and the Node Termination Handler on the same nodes race to cordon and drain. Pick one.
The interruption handler or node autoscaler on spot. The component that responds to a reclaim should not be reclaimable.
Testing in a quiet hour with one node. The failure is a correlated reclaim under load; a single quiet interruption proves only that one pod restarts.
Reference files
references/classification.md— read at steps 1 and 2: the recovery-time measurement sheet, how to size the on-demand floor, and edge cases such as instance storage, long connections and jobs that cannot be retried.references/provider-mechanics.md— read at steps 4, 6 and 7: per provider, the notice and how it arrives, the handler options and which to choose, node labels and taints, the floor mechanism, and how to inject an interruption.