Hey everyone! Today, I’m sharing a detailed post-mortem on a critical 10-minute service failure we experienced. ๐ฑ It all started when our Kubernetes auto-scaler, Karpenter, decided to consolidate three nodes at once, taking down over 20 pods simultaneously. Hereโs what happened and what we learned.

๐ Root Cause Analysis (RCA)
This failure was a “perfect storm” ๐ช๏ธ caused by several factors aligning at the worst possible time:
- Aggressive Karpenter Policy: We had recently changed our
consolidationPolicyto the more aggressiveWhenEmptyOrUnderutilizedand upgraded to v1.5.3, which has a more assertive consolidation algorithm. - Missing PodDisruptionBudget (PDB): This was the killer. ๐ฏ We had no PDBs configured for any service, including our critical
Config Server. - Cascading Failure (Dependency Hell): When the
Config Serverpod was terminated, all other services failed to start. Why? They couldn’t fetch their configurations, leading to a system-wide meltdown. domino: - Short Probe Timeouts: Our
readinessProbewas set to only 60 seconds, which wasn’t nearly enough time for our complex Spring Boot apps to initialize properly. โณ
๐ ๏ธ Solutions and Action Plan
We broke down our recovery into immediate, short-term, and mid-term actions.
- Immediate (P0) ๐ฅ:
- Apply PDBs (Mandatory!): We immediately added
PodDisruptionBudgetto all production services. This meansminAvailable: 1for critical services (likeConfig Server) andmaxUnavailable(e.g.,1or33%) for others. - Revert Karpenter Policy: We switched the
consolidationPolicyback to the saferWhenEmptyand are now implementing schedule-based consolidation (only during off-peak hours). ๐
- Apply PDBs (Mandatory!): We immediately added
- Short-Term (P1) ๐โโ๏ธ:
- Improve Probes: We increased the
initialDelaySecondsto 120s forreadinessProbeand added astartupProbeto give our apps plenty of time to start. - Add PreStop Hook: We implemented a
preStophook (e.g.,sleep 15) to ensure graceful shutdowns and connection draining.
- Improve Probes: We increased the
- Mid-Term (P2) ๐๏ธ:
- Decouple Dependencies: We’re configuring services with
spring.cloud.config.fail-fast: false. Now, services can start even if the Config Server is temporarily down. - Implement Resiliency: We’re strengthening our systems with Circuit Breaker patterns (with fallbacks) and adding dependency checks (DB, Config Server) to our application health indicators.
- Decouple Dependencies: We’re configuring services with
๐ Lessons Learned
This incident was painful, but the lessons are invaluable:
- PDBs are NOT optional. They are mandatory for any production workload. Full stop. โ
- Be conservative with infrastructure. Auto-scaling settings should be safe by default, not aggressive.
- Design for failure. Assume dependencies will fail and build resiliency (like circuit breakers and fallbacks) from day one.
Hope this breakdown helps someone else avoid the same “perfect storm”!
References : https://twodragon.tistory.com/m/695
Twodragon์์ ๋ ์์๋ณด๊ธฐ
๊ตฌ๋ ์ ์ ์ฒญํ๋ฉด ์ต์ ๊ฒ์๋ฌผ์ ์ด๋ฉ์ผ๋ก ๋ฐ์๋ณผ ์ ์์ต๋๋ค.
