πŸ“šBook Signing at KubeCon EU 2026Meet us at Booking.com HQ (Mon 18:30-21:00) & vCluster booth #521 (Tue 24 Mar, 12:30-1:30pm) β€” free book giveaway!RSVP Booking.com Event
Troubleshooting intermediate ⏱ 15 minutes K8s 1.28+

Debug Pod Eviction Reasons

Investigate why pods were evicted. Check node pressure, resource limits, priority classes, and preemption events.

By Luca Berton β€’ β€’ πŸ“– 5 min read

πŸ’‘ Quick Answer: Check kubectl describe pod <evicted-pod> for the eviction reason β€” usually The node was low on resource: memory or The node had condition: [DiskPressure]. Then check kubectl describe node <node> for pressure conditions and resource allocation.

The Problem

Pods are being evicted from nodes unexpectedly. They restart on other nodes but the instability disrupts services. You need to understand why evictions happen and prevent recurrence.

The Solution

Step 1: Find Evicted Pods

# List all evicted pods
kubectl get pods -A --field-selector status.phase=Failed | grep Evicted

# Get details on a specific eviction
kubectl describe pod <evicted-pod> -n <namespace>
# Look for:
# Status: Failed
# Reason: Evicted
# Message: The node was low on resource: memory.

Step 2: Check Node Pressure Conditions

# Check current node conditions
kubectl describe node worker-2 | grep -A5 Conditions
# MemoryPressure   False  ...
# DiskPressure     False  ...
# PIDPressure      False  ...

# Check allocated vs allocatable
kubectl describe node worker-2 | grep -A10 "Allocated resources"

Step 3: Understand Eviction Types

TypeTriggerBehavior
Node pressureMemory/disk/PID below thresholdkubelet evicts lowest-priority pods
PreemptionHigher-priority pod needs resourcesScheduler evicts lower-priority pods
API-initiatedkubectl drain or HPA scale-downRespects PDBs
OOM KillContainer exceeds memory limitNot technically eviction β€” kernel kills the process

Step 4: Set Proper Resource Requests and Limits

resources:
  requests:
    memory: "256Mi"    # Scheduling guarantee
    cpu: "250m"
  limits:
    memory: "512Mi"    # Hard ceiling β€” OOMKilled if exceeded
    cpu: "1"

Step 5: Configure Eviction Thresholds (if needed)

# Check kubelet eviction thresholds
kubectl get node worker-2 -o json | jq '.status.allocatable'

# Default soft thresholds:
# memory.available < 100Mi
# nodefs.available < 10%
# imagefs.available < 15%

Step 6: Use Priority Classes

apiVersion: scheduling.k8s.io/v1
kind: PriorityClass
metadata:
  name: high-priority
value: 1000000
globalDefault: false
description: "Critical workloads β€” evicted last"
---
apiVersion: apps/v1
kind: Deployment
spec:
  template:
    spec:
      priorityClassName: high-priority

Common Issues

Memory Pressure Eviction Loop

Pods evicted for memory β†’ rescheduled β†’ same node β†’ evicted again. Fix: set proper requests.memory so the scheduler doesn’t overcommit.

Disk Pressure from Container Logs

# Check log sizes on a node
oc debug node/worker-2 -- chroot /host du -sh /var/log/containers/* | sort -rh | head -10

Evicted Pods Accumulating

# Clean up evicted pods
kubectl delete pods -A --field-selector status.phase=Failed

Best Practices

  • Always set memory requests β€” prevents overcommitment that leads to memory pressure
  • Use PriorityClasses for critical workloads β€” they’re evicted last
  • Monitor node resource usage β€” alert before pressure thresholds are hit
  • Set resource limits β€” prevents a single pod from consuming all node resources
  • Clean up evicted pods periodically β€” they don’t auto-delete

Key Takeaways

  • Pod eviction is kubelet’s response to node resource pressure
  • Check kubectl describe pod for the eviction reason, kubectl describe node for current pressure
  • Proper resource requests prevent overcommitment
  • PriorityClasses control eviction order β€” highest priority evicted last
  • OOMKill (kernel) and eviction (kubelet) are different mechanisms
#eviction #node-pressure #resources #troubleshooting #oom
Luca Berton
Written by Luca Berton

Principal Solutions Architect specializing in Kubernetes, AI/GPU infrastructure, and cloud-native platforms. Author of Kubernetes Recipes and creator of CopyPasteLearn courses.

Kubernetes Recipes book cover

Want More Kubernetes Recipes?

This recipe is from Kubernetes Recipes, our 750-page practical guide with hundreds of production-ready patterns.

Luca Berton Ansible Pilot Ansible by Example Open Empower K8s Recipes Terraform Pilot CopyPasteLearn ProteinLens