liveBook · Manning

Pod eviction

As explained in Kubernetes for Developers

Pod eviction is the removal of a Pod from a node to reclaim resources during resource pressure or contention.

Pod eviction removes Pods from a node when finite resources, especially memory, are under pressure. Kubernetes reclaims capacity by targeting Pods that use more than their requested resources. Pods managed by a Deployment are typically rescheduled, often onto another node. section 5.1.3

Eviction behavior depends on resource configuration and priority:

  • Guaranteed Pods set limits equal to requests and are protected from eviction during resource contention. section 5.1.3 section 5.1.2
  • Best-effort Pods have no requests or limits and are considered first, beginning with those using the most contested resources. section 5.1.3
  • Kubernetes considers Pods using more than their requests, then ranks them by priority and excess use of the contested resource. section 5.1.3
  • Frequent evictions reduce workload availability and usually indicate that requests should increase or cluster capacity should be expanded. section 5.1.3

Reading an Evicted status

If a Pod reports Evicted, investigate whether it exceeded its requested resources. An occasional event may be acceptable; repeated events call for larger requests and possibly more compute capacity. section 5.1.3

Figure 5.5 Eviction order for Pods of equal priority
05-05

Use the eviction-order figure to compare which equal-priority Pods Kubernetes removes first. section 5.1.3

How Kubernetes for Developers covers it

How deep it goes
Explains triggers, QoS protection, ranking, status diagnosis, and remediation, but does not detail eviction implementation internals.
Examples
Uses equal-priority eviction-order figures, a PriorityClass manifest, and Deployment configuration with resource requests.
What it assumes
Assumes Pods and containers use resource requests and limits, while teaching QoS classes and eviction ranking.
What you can do after
Diagnose Evicted statuses, adjust resource requests, configure priority classes, and assess whether additional cluster capacity is needed.
How it connects
Connects resource requests, resource limits, quality of service, priority classes, preemption, Deployments, and scheduling.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Kubernetes for Developers. The section links point to the parts of the book it draws on.