⚡ ~/naveed Interview Prep
⚡ Portfolio Home ✍️ Engineering Blog Deep Dives 🎯 Interview Hub 998+ Scenarios ☸️ Kubernetes Mastery Hub 24 Modules 🎮 DevOps Arcade & Quizzes Subnet Blitz ⚡ 🗺️ DevOps Roadmaps PDFs & Guides 🤖 Morpheus Analysis AI Quant ↗ 🛠️ Developer Tools Utilities 🧪 Labs & Experiments 📄 Interactive CV & Certs 🔗 All Links & Socials ⚡ Join The Dispatch (Weekly SRE Newsletter) →
Staff SRE / Principal Architect [L3] Kubernetes Advanced Scenarios Staff SRE Scenario [L3]

Q: Explain how Kubernetes handles pod eviction during node memory pressure.

kubelet monitors node memory usage against eviction thresholds:

#Kubernetes #Advanced Scenarios #L3 #Container Orchestration #K8s
🎙️ Candidate Opening & Architectural Context
""In our production Kubernetes clusters running microservices on EKS/AKS, this was a classic operational challenge. When addressing this question, I walk the interviewer through our production incident runbook: isolating the blast radius, checking diagnostic logs and metrics, and applying a safe fix.""
Advertisement

🛠️ Production Runbook & Step-by-Step Resolution

1️⃣

Initial Diagnostics & Root Cause Analysis

kubelet monitors node memory usage against eviction thresholds:

  • Soft eviction — e.g., memory.available < 500Mi. kubelet gives pods a grace period (eviction-soft-grace-period, default 90s) to shut down before killing.
  • Hard eviction — e.g., memory.available < 100Mi. kubelet immediately kills pods with no grace period.
  • BestEffort pods first.
2️⃣

Remediation & Permanent Safeguards

Eviction order: After eviction, the node reports MemoryPressure condition and is tainted. New pods won't schedule there until pressure resolves.

  • Burstable pods that exceed their memory request (most over request first).
  • Guaranteed pods (last resort).
💡 The Senior SRE Gold Nugget (Key Architectural Takeaway)
"Pro-Tip: Soft eviction — e.g., memory.available . kubelet gives pods a grace period (eviction-soft-grace-period, default 90s) to shut down ."
⚡ 60-Second Elevator Pitch Talking Points
  • Soft eviction — e.g., memory.available . kubelet gives pods a grace period (eviction-soft-grace-p...
  • Hard eviction — e.g., memory.available . kubelet immediately kills pods with no grace period.
  • BestEffort pods first.
Advertisement
Want more Kubernetes scenarios?
Explore our complete collection of scenario-based Kubernetes interview runbooks.
Browse All Kubernetes Questions →

📚 Related Production Scenarios in Kubernetes