Fix Unexpected Pod Evictions in Kubernetes
Debug pods being evicted due to node pressure, preemption, or taint-based eviction. Understand eviction priorities, QoS classes, and PodDisruptionBudgets.
π‘ Quick Answer: Debug pods being evicted due to node pressure, preemption, or taint-based eviction. Understand eviction priorities, QoS classes, and PodDisruptionBudgets.
The Problem
This is a common issue in Kubernetes troubleshooting that catches both beginners and experienced operators.
The Solution
Step 1: Find Why the Pod Was Evicted
# Check pod events
kubectl describe pod evicted-pod-abc123 | grep -A5 "Status\|Reason\|Message"
# Reason: Evicted
# Message: "The node was low on resource: memory"
# Check node conditions at time of eviction
kubectl describe node worker-1 | grep -A10 ConditionsStep 2: Fix by Eviction Type
Node pressure eviction (memory/disk/PID):
# Set resource requests to get correct QoS class
# Guaranteed (highest priority β evicted last)
resources:
requests:
memory: "256Mi"
cpu: "250m"
limits:
memory: "256Mi" # Same as request
cpu: "250m" # Same as requestQoS eviction order:
BestEffortβ evicted first (no requests/limits)Burstableβ evicted second (requests β limits)Guaranteedβ evicted last (requests = limits)
Preemption (higher priority pod needs space):
# Check PriorityClass
kubectl get priorityclasses
# Higher priority pods preempt lower priority onesTaint-based eviction:
# Node got a NoExecute taint
kubectl describe node worker-1 | grep Taints
# Add toleration with tolerationSeconds for graceful handlingStep 3: Protect Critical Pods
apiVersion: policy/v1
kind: PodDisruptionBudget
metadata:
name: myapp-pdb
spec:
minAvailable: 2 # Always keep at least 2 running
selector:
matchLabels:
app: myappBest Practices
- Monitor proactively with Prometheus alerts before issues become incidents
- Document runbooks for your teamβs most common failure scenarios
- Use
kubectl describeand events as your first debugging tool - Automate recovery where possible with operators or scripts
Key Takeaways
- Always check events and logs first β Kubernetes tells you whatβs wrong
- Most issues have clear error messages pointing to the root cause
- Prevention through monitoring and proper configuration beats reactive debugging
- Keep this recipe bookmarked for quick reference during incidents

Recommended
Kubernetes Recipes β The Complete Book100+ production-ready patterns with detailed explanations, best practices, and copy-paste YAML. Everything in one place.
Get the Book βLearn by Doing
CopyPasteLearn β Hands-on Cloud & DevOps CoursesMaster Kubernetes, Ansible, Terraform, and MLOps with interactive, copy-paste-run lessons. Start free.
Browse Courses β