You want to run production workloads on Spot. How do you do it safely?
AdvancedScenarioCost
Answer
Situation read → Spot gives up to 90% off but can be reclaimed with a 2-minute warning. Safe use is about spreading risk and handling interruptions gracefully.
What I'd do →
- Only stateless, horizontally scaled services that tolerate losing a pod. Keep databases, Kafka and singletons on on-demand.
- Diversify: many instance families and sizes across all AZs, so one pool being reclaimed doesn't hit everything.
requirements:
- key: karpenter.sh/capacity-type
operator: In
values: ["spot", "on-demand"]
- key: karpenter.k8s.aws/instance-category
operator: In
values: ["c", "m", "r"]
- Handle interruptions: Karpenter's interruption queue (or AWS Node Termination Handler) cordons and drains on the 2-minute notice.
- Make pods shut down fast: honour SIGTERM, keep
terminationGracePeriodSecondsunder ~90s, and use PDBs. - Keep an on-demand base (for example 30%) so a mass reclaim never drops you below safe capacity.
Why → Diversity plus a fast, graceful drain is what makes Spot boring in production.
Interview tip → Mention the 2-minute notice and that your shutdown must fit inside it.
More on Cost
The AWS bill jumped 40% this month and finance wants an explanation by tomorrow. How do you find out why?BeginnerThe "NAT Gateway – data processed" line is $9,000 a month. How do you bring it down?IntermediateCut EKS compute cost by 40% without hurting reliability. What's your plan?AdvancedDev and test environments run 24/7 but are used only during office hours. How do you cut that cost?BeginnerCloudWatch Logs costs more than the EC2 fleet. What do you do?IntermediateFinance asks you to buy commitments. Savings Plans or Reserved Instances, and how much?Intermediate