PriorityClasses and their values
1
dev-pc (value:1000000)
2
preprod-pc (value:2000000)
3
prod-pc (value:4000000)
dev-nginx
%3CmxGraphModel%3E%3Croot%3E%3CmxCell%20id%3D%220%22%2F%3E%3CmxCell%20id%3D%221%22%20parent%3D%220%22%2F%3E%3CmxCell%20id%3D%222%22%20value%3D%22%26lt%3Bbr%26gt%3B%26lt%3Bbr%26gt%3B%26lt%3Bbr%26gt%3B%26lt%3Bbr%26gt%3B%26lt%3Bbr%26gt%3B%26lt%3Bbr%26gt%3Bdev-nginx%22%20style%3D%22sketch%3D0%3Bhtml%3D1%3Bdashed%3D0%3Bwhitespace%3Dwrap%3BfillColor%3D%232875E2%3BstrokeColor%3D%23ffffff%3Bpoints%3D%5B%5B0.005%2C0.63%2C0%5D%2C%5B0.1%2C0.2%2C0%5D%2C%5B0.9%2C0.2%2C0%5D%2C%5B0.5%2C0%2C0%5D%2C%5B0.995%2C0.63%2C0%5D%2C%5B0.72%2C0.99%2C0%5D%2C%5B0.5%2C1%2C0%5D%2C%5B0.28%2C0.99%2C0%5D%5D%3Bshape%3Dmxgraph.kubernetes.icon%3BprIcon%3Dpod%3BfontSize%3D12%3B%22%20vertex%3D%221%22%20parent%3D%221%22%3E%3CmxGeometry%20x%3D%22210%22%20y%3D%22340%22%20width%3D%2250%22%20height%3D%2248%22%20as%3D%22geometry%22%2F%3E%3C%2FmxCell%3E%3C%2Froot%3E%3C%2FmxGraphModel%3Epreprod-nginx
prod-nginx
Scheduling queue
Based on the priorityClass values, scheduler places all the pods in the queue. dev-nginx being the lowest and prod-nginx being the highest.
Do the worker nodes have enough resources to run the pods?
The preemption logic kicks-in and preempts lowest priority pod.
No
In our case we don't have enough resources. Therefore dev-nginx was evicted.
Scheduling of pods happens normally.
Yes
Lowest priority pod gets gracefully terminated to make room for high-priority pods.
Since we have enough room for high-priority pods, the scheduler schedules them.
In our case prod-nginx was successfully scheduled to node01.
Do the worker nodes have enough resources to run high priority pods now ?
Yes
No
Just in case there are still resource constraints, the process continues.