Okay, let's address the elephant in the kitchen: Spot instances scare people.
And honestly, that fear used to be fair. Today though? It's mostly a leftover worry from a recipe that's been updated three times since you last read it.
π€ Why Teams Avoid Spot
The classic fear: "Spot gets reclaimed and my app falls over."
That made total sense back when you were manually babysitting Auto Scaling Groups with no graceful handling. It doesn't really hold up anymore now that Karpenter's in the kitchen.
π§ How Karpenter Actually Handles Spot
AWS gives you a two-minute warning before reclaiming a Spot instance. Karpenter hears that warning and starts moving your pods to safety before the instance vanishes — like a waiter clearing your table the moment the kitchen says "this one's closing."
π Two minutes is plenty of time for a well-configured workload to shift seats without anyone at the table noticing.
⚙️ A Real Mixed-Capacity Recipe
apiVersion: karpenter.sh/v1
kind: NodePool
metadata:
name: spot-first
spec:
template:
spec:
requirements:
- key: karpenter.sh/capacity-type
operator: In
values: ["spot", "on-demand"]
- key: node.kubernetes.io/instance-type
operator: In
values: ["m5.large", "m5a.large", "m6i.large", "m6a.large"]
disruption:
consolidationPolicy: WhenEmptyOrUnderutilized
consolidateAfter: 30s
π The instance-type variety matters more than people think. More instance families means more Spot capacity pools to pull from, which means fewer interruptions in real life.
π‘️ Making Your Workloads Spot-Safe
Not everything belongs on Spot. Here's the actual split that works in the real world:
- Spot-friendly: stateless web services, batch jobs, CI runners, async workers
- On-demand only: databases, anything stateful without proper replication, single-replica anything
For anything multi-replica running on Spot, add a PodDisruptionBudget so Karpenter doesn't clear too many seats at the same table at once:
apiVersion: policy/v1
kind: PodDisruptionBudget
metadata:
name: web-pdb
spec:
minAvailable: 2
selector:
matchLabels:
app: web
⚠️ Common Mistakes
- Running single-replica deployments on Spot and acting shocked when there's downtime
- Restricting yourself to one or two instance types, then complaining about frequent interruptions
- No PodDisruptionBudget, so Karpenter (correctly) drains more pods at once than the app can handle
- Treating Spot as all-or-nothing instead of mixing Spot and on-demand per NodePool
π₯ CloudChef Pro Tip
Split the kitchen.
π Run critical-path services on a small on-demand NodePool, and everything else on a wide, diverse Spot NodePool. Most of the savings, almost none of the risk.
π Continue Your CloudChef Journey
π References
π Final Thoughts
Spot in 2026, paired with Karpenter, isn't the gamble it used to be. The interruption handling is real, the savings are real, and the setup takes maybe twenty extra minutes over a plain on-demand NodePool.
π That's a good trade. Your finance team will agree.
No comments:
Post a Comment