SCENARIO:
It's 2 AM, traffic is at 5%, but we have 50 nodes running at 10% utilization. Also, some nodes are running an old AMI from 3 months ago. How
does Karpenter handle both issues?
WHAT THEY'RE TESTING: Consolidation, Drift Detection, Expiration (TTL)
THE ANSWER:
• CONSOLIDATION (underutilized nodes):
disruption:
consolidationPolicy: WhenEmptyOrUnderutilized
consolidateAfter: 30s
- Karpenter identifies low-utilization nodes
- Drains pods to other nodes, terminates empty ones
• DRIFT DETECTION (old AMI):
- Karpenter compares node spec vs current NodeClass
- If AMI changed in NodeClass, node is marked 'drifted'
- Gracefully replaces with new node running correct AMI
• EXPIRATION (TTL):
expireAfter: 720h # Force refresh every 30 days
→ All three are types of DISRUPTION - Karpenter's cleanup mechanism