Free — no signup required

Strategy: Price-Capacity-Optimized Selection

2 min read

Why "Lowest Price" Is a Trap

Early Spot strategies used a Lowest Price allocation: find the cheapest instance available right now and buy it. This sounds rational until you understand the Spot market dynamics.

Spot prices are inversely correlated with available capacity. When an instance type is cheap, it usually means AWS has a surplus of it — but it also means everyone else is buying it too. The cheapest instance at any given moment is often the one with the shallowest capacity pool, making it the most likely to be interrupted when AWS needs those resources back for On-Demand customers.

Capacity Depth: The Hidden Variable

Karpenter uses the Price-Capacity-Optimized allocation strategy by default. Instead of sorting purely by price, it evaluates the depth of the capacity pool — essentially, how many instances of that type AWS has available in that Availability Zone right now.

Consider this scenario:

Instance Hourly Price Capacity Pool Interruption Risk
m5.xlarge $0.10/hr Shallow High
m5a.xlarge $0.12/hr Deep Low

Karpenter picks m5a.xlarge. You pay $0.02/hr more — about $14/month for a single instance — but your interruption rate drops significantly. At scale, across dozens of nodes, this trade-off is almost always worth it.

This logic is baked into Karpenter's provisioning loop. You don't write it; you just don't override it.

Diversification: The Second Defense

No single instance type has infinite capacity. Karpenter's NodePool lets you specify a list of acceptable instance families, and Karpenter will spread purchases across multiple types. If m5.xlarge capacity runs out, it falls back to m5a.xlarge, then m4.xlarge, and so on — all transparently, without operator intervention.

requirements:
  - key: node.kubernetes.io/instance-type
    operator: In
    values: ["m5.xlarge", "m5a.xlarge", "m4.xlarge", "m5d.xlarge"]

This diversification is the single most effective technique for reducing Spot interruption impact. A fleet of 10 different instance types is far more resilient than 10 instances of the same type.

This is one of 18 chapters

Every chapter is free — Kubernetes, Terraform, SRE, distributed systems, and more — with fast daily review built in.

Sign up free