K8s by Example: Pod Priority & Preemption
| Pod Priority determines scheduling order and preemption rights. Higher priority pods are scheduled first and can evict lower priority pods when resources are scarce. Use to protect critical workloads and enable graceful degradation under resource pressure. |
| priorityclass.yaml | |
| PriorityClass defines a priority level. Higher | |
|
| |
| priority-tiers.yaml | |
| Create a priority tier system for your cluster. Common pattern: system-critical > production > staging > batch. Leave gaps between values for future tiers. | |
| deployment-priority.yaml | |
| Reference the PriorityClass in your Pod spec. The scheduler uses this to order pending pods and determine preemption eligibility. | |
| terminal | |
| View all priority classes including built-in system priorities. | |
| Check which priority class a pod is using. Pods without explicit priorityClassName use the globalDefault or default to 0. | |
| terminal | |
| When preemption occurs, lower-priority pods are evicted to make room. Events show which pods were preempted and why. | |
| Preempted pods are terminated gracefully (SIGTERM, grace period). They appear with | |
| pdb-with-priority.yaml | |
| PodDisruptionBudgets interact with preemption. A PDB can prevent preemption if it would violate the disruption budget. Use PDB to protect critical services. | |
| Combine priority with PDB for layered protection. High priority prevents eviction by lower priority pods. PDB prevents eviction by any voluntary disruption. | |
| avoid-cascade.yaml | |
| Warning: Priority misconfiguration causes cascading evictions. If many high-priority pods become Pending, they can evict entire workloads. Use ResourceQuotas to limit high-priority pod counts. | |
Index | Use arrow keys to navigate