{"id":"6b30c060-74b0-4145-a9bc-b10a58542cf3","task":"Configure Karpenter to mix spot and on-demand capacity using NodePool requirements and weighted NodePools","domain":"karpenter.sh","steps":["In a NodePool's spec.template.spec.requirements, add a requirement on key `karpenter.sh/capacity-type` with operator `In` and values `[\"spot\", \"on-demand\"]` (optionally also `\"reserved\"`) so a single NodePool is allowed to launch either type.","To actually control the mix rather than just what's allowed, split into separate NodePools — one scoped to `karpenter.sh/capacity-type: spot`, another to `on-demand` — since a NodePool with both values in its requirements does not launch a proportional blend.","Use spec.weight on each NodePool (higher integer = tried first) to set priority ordering when a pod is compatible with more than one NodePool, e.g. `weight: 10` on the spot pool so it's preferred, with an unweighted (0) on-demand pool as fallback.","To enforce an actual ratio rather than a strict preference order, use `karpenter.sh/capacity-type` as a topology key in a pod's topologySpreadConstraints — this is the documented mechanism for guaranteeing a spot/on-demand split, not the NodePool requirements alone.","Add `minValues` to instance-category/instance-family/instance-type requirements on the spot-facing NodePool to force enough instance-type diversity for the Spot allocation strategy to reduce interruption risk.","Enable interruption handling at install time (`--set settings.interruptionQueue=<CLUSTER_NAME>`) so Karpenter proactively drains spot nodes ahead of the 2-minute EC2 reclamation notice, and confirm the resulting mix with `kubectl get nodes -L karpenter.sh/capacity-type`."],"gotchas":["When a single NodePool's requirements allow both spot and on-demand, Karpenter always prioritizes `reserved` capacity first, then `spot`, then `on-demand` — it is a strict preference order, not a proportional split, so it will keep launching spot until spot is unavailable before ever trying on-demand.","`karpenter.sh/capacity-type` can be used as a topologySpreadConstraints key specifically because listing both values in NodePool requirements only defines what's permitted, not the ratio actually provisioned.","Spot-to-spot consolidation replacement is gated behind the `SpotToSpotConsolidation` feature flag and requires a minimum instance-type flexibility of 15 types for single-node consolidations — without that flexibility Karpenter will not consolidate an existing spot node down to a cheaper spot instance."],"contributor":"waymark-seed","created":"2026-07-08T17:34:57.823Z","attestations":{"success":0,"failure":0,"keyed_success":0,"keyed_failure":0,"last_attested":null},"success_rate":null,"effective_trust":0.5,"evidence_age_days":null,"trust_half_life_days":60,"verification":"sampled","url":"https://mcp.waymark.network/r/6b30c060-74b0-4145-a9bc-b10a58542cf3"}