EKS Cost Levers
EKS compute costs break down into EC2 instance hours and data transfer. The biggest levers:
- Spot Instances — up to 90% cheaper than On-Demand; suitable for stateless, fault-tolerant workloads
- Karpenter consolidation — bin-packs pods onto fewer nodes and terminates empty/underutilized ones
- Right-sizing — match node instance type to workload memory/CPU profile
- Savings Plans / Reserved Instances — commit to 1–3 years for On-Demand baseline
Karpenter NodePools for Cost
Split workloads into separate NodePools by disruption tolerance:
# Stateless — Spot, aggressive consolidation
apiVersion: karpenter.sh/v1
kind: NodePool
metadata:
name: stateless-spot
spec:
template:
spec:
requirements:
- key: karpenter.sh/capacity-type
operator: In
values: ["spot"]
disruption:
consolidationPolicy: WhenEmptyOrUnderutilized
consolidateAfter: 10m
---
# Stateful — On-Demand, conservative consolidation
apiVersion: karpenter.sh/v1
kind: NodePool
metadata:
name: stateful-ondemand
spec:
template:
spec:
requirements:
- key: karpenter.sh/capacity-type
operator: In
values: ["on-demand"]
disruption:
consolidationPolicy: WhenEmpty
consolidateAfter: 30m
Spot Interruption Handling
Spot instances can be reclaimed with a 2-minute warning. Karpenter handles interruption by:
- Receiving the interruption notice via EventBridge
- Cordoning the node immediately
- Draining pods (respecting PDBs)
- Launching a replacement node in parallel
Workloads need PodDisruptionBudgets and quick startup times to tolerate this gracefully.
Choosing Instance Families
Use requirements to restrict instance families:
requirements:
- key: node.kubernetes.io/instance-type
operator: In
values: ["m5.large", "m6i.large", "m6a.large", "m7i.large"]
Mixing families increases Spot availability — AWS has more capacity to offer across multiple instance types.
Cost Visibility
Use AWS Cost Explorer with the eks:cluster-name tag to break down costs per cluster. Tag nodes via Karpenter's nodeClassRef template labels:
metadata:
labels:
cost-center: platform
Further Reading
Karpenter Cost Optimization