Skip to content

Preemption

Preemption allows a high-priority pod to evict lower-priority pods to get scheduled on a node.

Low Priority
High Priority
High priority pod preempts low priority

Mental Model

Like priority boarding for flights - a VIP (high-priority pod) can take the seat of a regular passenger (low-priority pod). The lower-priority pod gets bumped and must wait for another flight (node).

YAML Example

apiVersion: scheduling.k8s.io/v1
kind: PriorityClass
metadata:
  name: high-priority
value: 1000
globalDefault: false
description: "High priority pods"

---
apiVersion: v1
kind: Pod
spec:
  priorityClassName: high-priority
  containers:
  - name: app
    image: myapp

Common Misconceptions

  • ✗All pods can preempt - FALSE: Only pods with higher priority
  • ✗Preemption is automatic - TRUE: Scheduler handles it
  • ✗Preempted pods are deleted - TRUE: They're terminated and must restart

Key Takeaways

  • • Preemption allows a high-priority pod to evict lower-priority pods to get scheduled on a node.
  • • Like priority boarding for flights - a VIP (high-priority pod) can take the seat of a regular passen...
  • • Check the YAML example for implementation details
  • • Be aware of the common misconceptions listed above
Kubernetes Cosmos•An interactive learning experience
Built by GLM 4.7