Originally published on Medium: https://medium.com/@seshikanthguduri/when-spot-nodes-eat-your-ci-pipeline-1bfc53a7f79b

Spot vs on-demand in EKS, provisioned by Karpenter: same cluster, two very different capacity promises.

Every platform team eventually learns the same lesson: spot instances are cheap right up until they are not.

The setup: all spot, all the time

We ran a busy Kubernetes CI workload on a node pool built entirely on spot capacity. It worked well for a long time, which is exactly the problem. Spot interruptions are rare enough that the risk stays invisible, until one day jobs start failing with errors that look like application problems. In our case the symptom was simple: jobs could not get a node. Pods sat unscheduled or died mid-run, and the error messages pointed everywhere except the real cause.

Figure 1 — How CI jobs flowed through the cluster: every job landed on spot capacity.

Read the flow left to right. A pipeline job becomes a pod. The scheduler looks for a node with room. If none exists, Karpenter creates one from the pool. The pool is the quiet decision in this diagram: it defines where capacity comes from. Ours said spot only, which means every node in the chain existed at the cloud provider's pleasure.

Where it went wrong

The real cause was capacity. The node provisioner was doing its job correctly. When the cloud provider reclaimed spot capacity, nodes were terminated, and because the pool had no reserved or on-demand capacity behind it, there was nothing guaranteed to replace them. CI is a bad fit for that gamble. A batch job can often retry, but a pipeline is a chain: one lost node can fail a stage, block a merge, and quietly tax every engineer waiting on it.

Figure 2 — Where it went wrong: a capacity event upstream became a pipeline failure downstream.

The chain matters more than any single step. Spot reclamation is normal behavior, and Karpenter terminating the node is correct behavior. The failure is designed in at step zero, when the pool was built with no guaranteed capacity behind it. By the time a job reports that no node is available, the real event is already three steps upstream, which is why the first hours of debugging went toward the jobs themselves.

The fix: tier the capacity

The fix was boring, which is usually a sign it is right. We moved the critical pool to on-demand instances, managed through Terraform like everything else in the platform. Failures cleared across the pipeline, not just in the job that first reported the problem.

That does not mean spot has no place. It means capacity needs tiers, decided on purpose:

  • Critical, latency-sensitive, or chain-blocking workloads get guaranteed capacity: on-demand or reserved.
  • Fault-tolerant, retry-friendly batch work can ride spot and take the savings.
  • The tiering has to be codified in infrastructure as code, not left as tribal knowledge, so the next pool is built right by default.

Figure 3 — The fix: capacity in tiers, decided on purpose.

Taints and tolerations do the routing. The critical pool carries a taint that only pipeline workloads tolerate, so batch jobs cannot drift onto the expensive capacity. The batch pool stays spot and keeps the savings for work that retries cleanly. Neither pool is a console change: both are Terraform, reviewed like any other production change.

Measure it, or it happens again

The second lesson is about measurement. "The pipeline feels flaky" is not an SLO. Track scheduling success rate, time pods spend pending, and node termination events per pool. When those numbers exist, the cost conversation changes. You are no longer arguing about instance prices; you are comparing a known compute increase against a known amount of lost engineering time.

Spot is a tool. Like every tool, it has a load limit. Put it under the wrong workload and it will hold, right up until the day it does not, and that day always arrives during someone else's deadline.