Pod Priority and Preemption in Kubernetes
Learn how Kubernetes decides which workloads matter most when a cluster runs out of room, how it makes space for important pods by removing less important ones, and how to design this safely.
Picture a small restaurant on a rainy Saturday night. Every table is full, and the door opens. A family with a reservation arrives, and so does a stranger who simply walked in. There is no free table. What should the host do? A sensible host might politely ask a group that has finished eating and is only chatting over coffee to move to the bar, so that the reserved family can sit. The host would never ask someone in the middle of a main course to leave, and would never ask the owner’s own family to give up their table. The host is making decisions based on how important each group is and how easily each can be moved.
Kubernetes faces this exact situation all the time. A cluster is a limited set of machines, and workloads keep arriving. Some workloads are vital, such as the parts that keep the cluster itself running. Others are pleasant but not urgent, such as a nightly report. Pod priority and preemption are the tools Kubernetes gives us to tell it which is which, and to let it make room for important work when space is short. In this guide, we will build the idea from the ground up. You do not need any earlier knowledge. Every new word is explained the first time it appears, with a simple comparison from everyday life.
1What Are Pod Priority and Preemption?
Priority is a ranking that says how important a pod is, and preemption is the act of removing less important pods so that a more important one can run.
Two Ideas, One Team
Pod priority is simply a number attached to a pod. A bigger number means the pod is more important. That is all it is. By itself, the number does nothing dramatic. It changes the order in which waiting pods are looked at, so that important pods are considered before unimportant ones.
Preemption is the dramatic part. When an important pod cannot find any machine with enough free space, Kubernetes can look for machines that are running less important pods. If removing some of those less important pods would create enough room, Kubernetes removes them, which is called evicting or preempting them, and then the important pod takes the space. The removed pods are not destroyed forever in most cases. They go back into the waiting line and are placed elsewhere when room appears.
Think of an airport boarding queue where first class passengers board before economy. That order is priority. Now imagine the flight is overbooked and an important passenger arrives late. The airline asks a volunteer in economy to take a later flight. That act of making a seat available by moving someone less important is preemption.
What Problem This Solves
Without priority, Kubernetes treats every pod as equally important. When the cluster is full, whichever pod arrived first wins, and whichever arrives later waits, even if the late pod is a critical part of your business and the early one is a throwaway experiment. Priority and preemption fix this by letting you say clearly which work must survive and which work can give way.
Priority is about scheduling, which means choosing where a pod runs. It is a different thing from quality of service classes and from the kubelet removing pods when a machine is short of memory. We will separate these three ideas carefully in a later chapter, because mixing them up is a very common source of confusion.
2Why Clusters Run Out of Room
Every cluster is finite, and real demand is bursty, so moments of shortage are normal and not a sign that something is broken.
Finite Machines, Growing Demand
A Kubernetes cluster is made of a fixed number of machines, and each machine has a fixed amount of processor power and memory. Teams keep adding applications, and each application asks for a slice of these resources. At first there is plenty of room. Over time the cluster fills up. Sooner or later, a new pod arrives and no machine can hold it.
Adding more machines is the obvious answer, and many clusters do this automatically. But machines cost money and take time to start, and sometimes a limit is reached, such as a budget, a quota from the cloud provider, or a physical data center that has no more space. Even with automatic growth, there is always a gap of a few minutes in which a pod waits. During that gap, what should run and what should wait?
The Cost of Idle Capacity
A natural response to the shortage problem is to buy enough machines that nothing is ever pending. This works, but it is expensive. Most workloads do not use their full reservation all day, and most clusters have quiet hours. Machines that sit idle still cost money for electricity, licenses, and rent. Finance teams notice this quickly, and they ask why the cluster is half empty most of the time.
Priority and preemption let a team run the cluster fuller, because there is a safety net. If a burst of important work arrives, less important work steps aside instead of the important work failing. The cluster can be sized for the everyday load rather than for the rare peak. This trade, accepting some disturbance to low-value work in exchange for lower cost, is the deeper reason the feature exists.
Sharing a Cluster Among Different Kinds of Work
To save money, organizations often run many kinds of work on the same cluster. There are user-facing services that must always answer quickly. There are background jobs that can run at any time. There are experiments by data scientists. And there are platform helpers, such as programs that collect logs or provide networking, without which the whole cluster would struggle. These different kinds of work have very different levels of importance, yet they all compete for the same machines.
Consider a shared office building with one small parking lot. Doctors on emergency call, regular staff, and visitors all want to park. If the lot is first come, first served, an emergency doctor might circle the block while a visitor who arrived early sits in a good spot for hours. A sensible building reserves some places for emergencies and asks casual visitors to move when needed.
Some beginners think that a pod stuck in the pending state means Kubernetes is broken. Usually it simply means there is no room right now. Priority and preemption exist precisely to decide who gets room first when this happens.
3Kubernetes Building Blocks You Need First
A handful of basic terms will make everything else in this guide easy to follow.
Kubernetes is a system that runs applications packed inside containers, which are lightweight boxes holding an application together with everything it needs. Kubernetes decides where these boxes run, restarts them when they fail, and connects them together. Think of Kubernetes as the manager of a large warehouse who keeps every box in the right place. Here are the words we will use most.
Pod
The smallest unit that Kubernetes runs. A pod wraps one or more containers that live and die together, like one apartment for close roommates.
Node
A single machine in the cluster, real or virtual, that provides the processor and memory where pods run. Nodes are the tables in our restaurant.
Scheduler
The part of Kubernetes that chooses which node each new pod should run on. It is the host who seats the guests.
Pending
The state of a pod that has been created but not yet placed on any node, usually because there is no suitable room yet.
Resource Request
The amount of processor and memory a pod promises to need. The scheduler uses requests to decide whether a node has room.
Resource Limit
The ceiling a pod is not allowed to exceed while running. A request is a reservation, while a limit is a hard cap.
Eviction
The removal of a running pod from a node. It can happen because of preemption, node pressure, or a planned maintenance step.
Namespace
A named section of a cluster used to separate teams or projects, like different floors of the same building.
Requests Are What the Scheduler Sees
One point deserves special attention. The scheduler makes room decisions using requests, not actual usage. If a pod asks for two units of processor, the scheduler sets aside two units for it on a node, even if the pod is currently using only half of that. This is like a restaurant holding a table for a party of four even if only two have arrived so far. Understanding this makes it clear why a cluster can look half empty in usage graphs and yet refuse to place a new pod: the room is reserved on paper.
A hotel books rooms by reservation, not by who is currently inside. A guest might be out sightseeing all day, but the room is still theirs. The front desk cannot give it to someone else, even though it looks empty, unless the reservation is cancelled.
4How the Scheduler Places a Pod
Before we can understand preemption, we need to see the normal path a pod takes, because preemption is what happens when that normal path fails.
The Waiting Line
When a new pod is created, it is added to a queue inside the scheduler. The scheduler picks pods from this queue one at a time and tries to place each on a node. Without priority, the queue is roughly first in, first out. With priority, the queue is sorted, so pods with higher priority numbers are picked before pods with lower numbers, even if the lower ones arrived earlier.
Filter, Score, Bind
For each pod, the scheduler goes through three stages. First it filters: it removes every node that cannot possibly run the pod, for example because it lacks enough free processor or memory, or because the pod has rules that exclude the node. Second it scores: among the nodes that survive, it gives each a rating based on things like how balanced the load would be, and picks the best. Third it binds: it records the decision, telling the chosen node to run the pod.
graph LR
Q["Pod waits in queue"] --> F["Filter nodes"]
F --> S["Score remaining nodes"]
S --> B["Bind pod to best node"]
F -->|"No node fits"| P["Try preemption"]
P -->|"Room can be made"| N["Evict lower priority pods"]
P -->|"Still no room"| W["Pod stays pending"]
When Filtering Leaves Nothing
Sometimes the filter stage removes every single node. All of them are too full or fail some rule. In a cluster without priority, the pod would simply wait in the pending state until something changes. With priority enabled, the scheduler takes one more step before giving up: it asks whether removing lower-priority pods from some node would make the pod fit. If the answer is yes, preemption begins. If the answer is no, the pod waits.
The host first checks every table for an empty seat. That is filtering. Among the empty seats, the host picks the nicest. That is scoring. Then the host walks the guests to the table. That is binding. Only if there is truly no empty seat anywhere does the host consider asking someone finished with their meal to move.
Preemption is a last resort and never the first move. If any node has free room, the pod goes there and nobody is disturbed. Preemption only appears when the cluster is genuinely full for that pod.
5PriorityClass: The Ranking Card
A PriorityClass is the object that gives a name and a number to an importance level, so that pods can simply point to it.
What a PriorityClass Is
Rather than stamping a raw number onto every pod, Kubernetes uses a separate object called a PriorityClass. It belongs to the whole cluster and not to any single namespace. Each PriorityClass has a name, such as business-critical or batch, and a value, which is the number. Pods then refer to the class by name, and Kubernetes fills in the number for them. This keeps the ranking in one place, so administrators define the levels once and everyone else simply picks a level.
Value
The whole number that ranks this class. Higher means more important. User-defined classes may go up to one billion, and larger numbers are kept for system use.
Global Default
A yes or no switch. If set to yes, pods that name no class receive this one. Only one class in the cluster may be the default.
Preemption Policy
Says whether pods of this class may evict lower-priority pods. The normal setting allows it, and a special setting called Never forbids it.
Description
A short note in plain words explaining when this class should be used, so that teams choose wisely.
The Built-In System Classes
Kubernetes ships with two special classes for the most essential components. One is called system-cluster-critical and the other system-node-critical, and the second is ranked slightly higher. They are meant for programs that the cluster cannot live without, such as the internal name lookup service or programs that must run on every machine. Their numbers are above the one billion limit for ordinary classes, so no normal class can outrank them.
| Class Kind | Typical Value Range | Intended Use |
|---|---|---|
| System node critical | Highest, above two billion | Components every node needs to function |
| System cluster critical | Just below node critical | Essential cluster-wide services |
| User defined classes | Up to one billion | Your own applications, in tiers |
| Default, no class named | Zero | Pods that never asked for a ranking |
| Negative values | Below zero | Work that should always yield, such as placeholders |
A PriorityClass is like the colored wristband at a festival. Instead of writing a long explanation on each visitor, staff hand out a gold, silver, or plain wristband, and everyone at the gates instantly understands the level. The wristband definitions are kept in one place by the organizers.
The number inside a PriorityClass cannot be edited after the class is created. If you need a different number, you create a new class and move workloads to it. This prevents the ranking of running workloads from silently shifting under everyone’s feet.
6How a Pod Receives Its Priority
A pod does not choose its own number. It names a class, and the cluster looks up the number when the pod is created.
Naming a Class
In the description of a pod, the owner may write the name of a priority class. When the pod is created, a check point inside the cluster, called the admission process, looks up that class and copies its number onto the pod. If the class does not exist, the pod is rejected, which prevents typing mistakes from silently giving a pod the wrong importance. If the pod names no class, it receives the number from the default class, or zero if no default class exists.
Owners of pods are not allowed to write the number directly in a way that disagrees with the class. This protects the design: the meaning of each level stays in the hands of those who manage classes, and ordinary users only pick from the menu.
Administrator defines classes
A cluster owner creates a small set of named levels, each with a number and a description.
Developer names a class
The application team picks the level that fits their workload and writes its name in the pod description.
Admission fills in the number
When the pod is created, the cluster looks up the class and stamps the numeric priority onto the pod.
Scheduler uses the number
The scheduler sorts its waiting line and judges preemption using the stamped number.
Existing Pods Keep Their Number
The number is stamped once, at creation. If a class is deleted later, pods that already carry its number keep it and continue running. Only new pods that name the deleted class are refused. Likewise, if you change which class is the default, existing pods are not touched. Only pods created afterwards get the new default. This behavior is helpful, but it also means that a change in your priority design takes effect only as workloads are recreated.
Think of a wristband already fastened on someone’s wrist. If the festival changes the color scheme tomorrow, the people who already have wristbands keep them for the day. Only newcomers get the new colors.
Set a sensible default class early, usually a low or middle tier. Otherwise every pod that forgets to choose a level gets zero, which may accidentally outrank your deliberately low-priority batch work if that work uses negative numbers.
7Priority in the Scheduling Queue
Even without any eviction, priority quietly shapes who gets seated first, and this alone often solves many small problems.
Sorting the Line
The scheduler keeps waiting pods in several holding areas. The active area holds pods ready to be tried right now. Another area holds pods that failed recently and are resting for a short backoff period before trying again. A third holds pods that cannot be placed until something in the cluster changes. Within the active area, pods are ordered by priority first, and by arrival time second. So a high-priority pod that arrives late still moves to the front of the active line.
Active Queue
Pods being tried now, sorted with the highest priority at the front and older pods ahead of newer ones within the same level.
Backoff Queue
Pods that failed to fit and are waiting a short, growing delay before another attempt, so the scheduler is not flooded with retries.
Unschedulable Pool
Pods parked until a relevant event, such as a node joining or a pod leaving, suggests they might fit now.
Why Ordering Alone Helps
Imagine a cluster that has just gained a new machine, and twenty pods are waiting. Only five of them will fit. With ordering, the five most important ones are placed first. Without ordering, the five oldest are placed, which might be the least important ones. So even before we consider evicting anyone, priority makes sure that scarce room goes to the most valuable work.
A doctor’s waiting room with a triage nurse does not simply serve people in arrival order. Someone with a serious emergency is seen before someone with a mild cold, even if the cold patient arrived an hour earlier. The nurse is sorting the queue by urgency, which is exactly what priority does to the scheduling line.
If high-priority pods keep arriving, low-priority pods may wait a very long time, or forever. Priority is a promise to the important, and a risk to the unimportant. Plan for this when you decide which work sits at the bottom of your levels.
8Preemption: Making Room by Evicting
When no node has room, preemption searches for a node where removing lower-priority pods would let the waiting pod fit.
The Step-by-Step Story
Suppose a high-priority pod, which we will call the newcomer, is waiting and no node can hold it. The scheduler now enters the preemption stage. It looks at each node and asks a careful question: if I removed some of the pods on this node that have lower priority than the newcomer, would the newcomer then fit? Nodes where the answer is yes become candidates. The scheduler then picks the best candidate using rules we will study in the next chapter, marks which pods will be removed, and sends deletion requests for them.
sequenceDiagram
participant N as High priority pod
participant S as Scheduler
participant K as Node with low priority pods
N->>S: Waiting, no node fits
S->>S: Search nodes for removable lower priority pods
S->>K: Delete chosen victim pods politely
S->>N: Note the nominated node
K-->>K: Victims finish shutting down
S->>K: Place the high priority pod
K-->>N: Newcomer starts running
The pod cannot be placed
Filtering removes every node, so the normal path has failed for this pod.
Candidates are found
The scheduler finds nodes where removing only lower-priority pods would create enough room.
One node and its victims are chosen
Rules pick the node that causes the least harm, and name the specific pods to be removed.
Victims are asked to leave
Each victim receives a shutdown request and gets its normal grace period to finish work and exit cleanly.
The newcomer is placed
Once the space is truly free, the scheduler places the high-priority pod on that node.
What Happens to the Victims
The victim pods are not banished forever. If a victim belongs to something like a deployment, the deployment notices that a pod is missing and creates a replacement. The replacement goes into the waiting line, and it will be placed wherever room appears. If the cluster is still full, the replacement simply waits, at its own lower priority, behind more important pods. A pod that was created on its own, without any controller watching over it, is simply gone.
The host does not throw a group out of the restaurant. The host asks them to finish their coffee at the bar. They are still customers, just moved, and they will be seated at a table again when one becomes free.
Every preemption disrupts real work. Requests being handled by a victim may fail, and caches or in-memory state may be lost. Preemption is a tool for emergencies and priorities, not a cheap way to reshuffle a cluster all day.
9Choosing the Victims Fairly
The scheduler follows a clear set of tie-breaking rules so that the smallest and least harmful set of pods is removed.
Only Lower Priority Pods Are Eligible
The first rule is simple and firm. Only pods with a strictly lower priority than the newcomer can be victims. Pods of equal priority are never removed for each other. This prevents two equally important pods from endlessly pushing each other out.
Minimizing the Damage
Often several nodes could work. The scheduler then compares them using a sequence of tests, moving to the next test only if the earlier one is a tie. Roughly speaking, it prefers the node where the fewest disruption promises would be broken, then the node whose most important victim is least important, then the node where the total importance of victims is smallest, then the node with the fewest victims, and finally the node where the most important victims have been running for the shortest time. The idea behind all of these is to hurt as little valuable work as possible.
| Order | Question Asked | Why It Matters |
|---|---|---|
| 1 | Which node breaks the fewest disruption budgets? | Protects workloads that asked for a minimum number of healthy pods |
| 2 | Which node’s most important victim is the least important? | Avoids sacrificing anything that is close in rank to the newcomer |
| 3 | Which node has the smallest total priority among victims? | Removes the cheapest overall set of work |
| 4 | Which node has the fewest victims? | Disturbs the smallest number of pods |
| 5 | Which node’s top victims started most recently? | Wastes the least accumulated running time |
Suppose you must free up two seats on a crowded train for important passengers. You would first look for seats held by people who are least likely to mind, avoid asking someone with a special medical need, and prefer to ask as few people as possible. That is the same logic of causing the smallest inconvenience.
Chain Reactions and Ping-Pong
Preemption can set off a chain of events that surprises newcomers. When a victim is removed, its controller creates a replacement, and that replacement now needs a place. If the cluster is still full, the replacement may itself preempt an even lower-priority pod, which is then recreated and may preempt something lower still. Each step obeys the rules, yet the combined effect is a ripple of disturbance moving down the ladder of importance until it reaches work that can be lost without harm, or until spare room is found.
The ripple is usually short, because most clusters have only a few levels and the lowest level cannot preempt anyone. But in a cluster with many closely spaced levels, a single important arrival can shake dozens of pods. This is one more reason to keep the number of tiers small, and to make sure the bottom tier is truly disposable. A calm cluster is one where the ripple ends quickly and harmlessly.
Removing Only What Is Needed
Once a node is chosen, the scheduler tries to spare as many pods as it can. It first imagines removing every eligible lower-priority pod, checks that the newcomer would fit, and then tries adding the pods back one by one, from the most important to the least, keeping each one that does not spoil the fit. What remains is the smallest set of victims that still makes room. This gentle approach keeps as much running work as possible untouched.
Because the scheduler prefers fewer, smaller, less important victims, having many small low-priority pods spread around is often friendlier to preemption than a few huge ones. A single very large low-priority pod may be the only way to free enough room, and then it is removed whole.
10The Nominated Node and the Waiting Gap
A preempting pod does not start the instant its victims are chosen, and the gap between the two moments has surprising consequences.
Why There Is a Gap
Deleting a pod is not instant. A politely stopped pod is given a grace period, commonly around thirty seconds, to finish requests and shut down. During this time, its resources are still held. So even after the scheduler has decided who must go, the newcomer cannot start until the victims have truly left. In between, the newcomer sits in the pending state.
To keep track, the scheduler writes a note on the newcomer called the nominated node. It says, in effect, that this pod expects to be placed on that node once the room is cleared. The note also helps the scheduler avoid handing the same freed space to some other, lower-priority pod in the meantime, because it treats the nominated space as spoken for.
The host puts a small reserved sign on a table while the previous group finishes their coffee and gathers their coats. The important family is waiting in the entrance, and the sign says the table is theirs. But the family cannot sit down until the old group has actually stood up.
A Nomination Is Not a Guarantee
The nominated node is a strong hint, not a promise. While the victims are shutting down, things can change. Another node might free up sooner, and the newcomer may be placed there instead. A pod with even higher priority might arrive and claim the space. Or the victims might finish so quickly that the newcomer fits without waiting. Because of this, the scheduler re-checks the newcomer each time and may change its mind.
Everything Goes as Planned
Victims exit, the newcomer is placed on the nominated node, and the note is cleared.
Another Node Opens First
Some other node frees up sooner, so the newcomer is placed there and the original victims may have left for little gain.
An Even More Important Pod Arrives
A higher-priority pod takes the room, and the newcomer must try preemption again elsewhere.
Victims Are Replaced Quickly
Controllers recreate the victims, which then wait behind the newcomer because their own priority is lower.
Seeing a pod with a nominated node that is still pending is normal during a preemption. It does not mean the cluster is stuck. It means the scheduler is waiting for victims to finish leaving. Only worry if the state lasts far longer than the grace period of the victims.
11Non-Preempting Priority: The Polite Setting
Sometimes work is important enough to be seated early but not important enough to push anyone out, and Kubernetes has a setting for exactly this.
The Never Setting
Each PriorityClass has a preemption policy. The usual value allows pods of that class to evict lower-priority pods. The other value, called Never, tells the scheduler that pods of this class may go ahead of lower-priority pods in the waiting line, but must never evict anyone to get a place. If there is room, they are placed quickly. If there is no room, they simply wait patiently, even though they outrank some running pods.
A frequent diner holds a priority card that lets them skip ahead of walk-in guests in the waiting line. But the card does not let them ask anyone already eating to leave. They wait for a table to open naturally, only ahead of others who are also waiting.
When to Use It
The Never setting is popular for work that is valuable but tolerant of delay and costly to interrupt others for. A classic case is a long data-processing job, such as training a machine-learning model. The job matters more than casual experiments, so it should be placed before them when room appears. But it does not justify killing running services just to start sooner. Using Never keeps the cluster calm while still giving these jobs a fair advantage in the line.
Long batch and training jobs
They deserve to be scheduled ahead of low-value work, but interrupting running services for them would cause more harm than waiting a bit.
Scheduled reports and cleanups
These are useful and ordered by importance, yet they are never urgent enough to justify disrupting a customer-facing workload.
Shared research clusters
Teams with different levels of importance can share one cluster fairly, with ordering in the line but no evictions between projects.
| Behavior | Normal Priority | Non-Preempting Priority |
|---|---|---|
| Goes ahead of lower priority pods in the queue | Yes | Yes |
| May evict lower priority running pods | Yes | No |
| Can be evicted by higher priority pods | Yes | Yes |
| Typical use | Critical services | Important but patient work |
A non-preempting pod can still be preempted by others. The Never setting only removes its own right to evict, not its vulnerability. Its priority number still counts when higher-priority pods look for victims.
12Disruption Budgets and Preemption
A disruption budget lets an application say how many of its pods may be unavailable at once, but preemption treats it as a wish and not a law.
What a Disruption Budget Is
A PodDisruptionBudget is an object in which the owner of an application states a limit, such as at least three pods must always stay up, or at most one pod may be down at a time. Planned actions, such as draining a machine for maintenance, respect this promise strictly. They will wait rather than break the budget. This is how careful teams keep their services healthy during routine cluster work.
Best Effort Only
Preemption respects disruption budgets only on a best-effort basis. The scheduler prefers victims whose removal breaks the fewest budgets, as we saw in the earlier ranking. But if no arrangement can avoid breaking a budget, the scheduler will go ahead anyway, because otherwise a truly important pod might never run. This surprises many people, who assume the budget is an absolute shield.
Imagine a building manager who promises to avoid closing more than one elevator at a time for repairs. In ordinary maintenance, the promise is kept. But in an emergency where a fire truck must reach an upper floor, the manager might override the promise. The promise guides normal behavior but yields to a stronger need.
What This Means for Your Design
Do not rely on a disruption budget alone to protect a workload from preemption. If a workload truly must not be evicted by any other pod, give it a high enough priority that the scheduler rarely finds it eligible as a victim. Use budgets as a second layer of care, and use priority as the first. Also give important workloads more than one copy spread across nodes, so that even a single unlucky eviction does not remove the whole service.
Problem
A team protects an important service only with a disruption budget and gives it the same priority as everything else on the cluster.
Why It’s Harmful
When a more important pod needs room, this service is a valid victim, and the budget is treated as best effort. The service can lose several pods at once and drop below the safe minimum.
Correct Approach
Assign a suitable priority class to the service, run several replicas across different nodes, and keep the disruption budget as an additional safeguard.
13What Preemption Cannot Fix
Preemption only frees resources, so any pod that is blocked by rules instead of by room will not be helped by it.
Rules Versus Room
A pod can fail to fit for two very different reasons. The first is a shortage of room: not enough processor or memory. Preemption can help with this, because evicting pods frees resources. The second is a rule that the pod itself carries, for example a requirement to run only on machines with a special label, or a taint on a machine that the pod does not tolerate. No amount of evicting other pods will change a label or remove a taint, so preemption does not try to fix these situations. The scheduler recognizes that the node is unsuitable for a reason other than room, and skips it.
If a family needs a wheelchair-accessible table and the only free tables are up a flight of stairs, asking other guests to leave downstairs tables does not help unless the downstairs tables themselves are accessible. The problem was never a lack of seats, it was the kind of seat. Preemption clears seats, but it cannot turn a staircase into a ramp.
Affinity Toward Lower Priority Pods
Pods can ask to run near certain other pods, which is called affinity. Suppose a high-priority pod says it wants to sit on the same node as a particular low-priority pod. If that low-priority pod is the only thing standing between the newcomer and free room, evicting it would destroy the very thing the newcomer wanted to be near. The scheduler understands this and does not preempt in such a case. It looks for a different node instead.
Fragmented Free Space
Another quiet cause of pending pods is fragmentation. Imagine a cluster with plenty of total free room, but scattered in small pieces across many machines, each piece too small to hold a large pod. The cluster looks half empty, yet a big pod cannot fit anywhere. Preemption can help by removing a few small pods on one machine to join the pieces into one usable block. But it cannot merge free room across machines, so a pod that needs more room than any single machine can offer will wait regardless of priority.
The lesson is to keep pod sizes reasonable compared with machine sizes, and to avoid a mix of very large and very small pods when you can. Uniform sizes pack together more neatly, like boxes of the same shape in a delivery truck, and they make both scheduling and preemption more predictable.
One Node at a Time
Preemption also looks at each node on its own. It does not attempt clever plans in which pods on several nodes are removed together so that a rule spanning many nodes becomes satisfied. For example, a rule that says two pods must never share the same zone might need evictions in another location to be satisfied, yet the scheduler only considers evictions on the single node where the newcomer would land. In such cases the pod may stay pending even though a smarter, more global plan might exist.
Labels and Selectors
A pod that must run on a certain kind of node is not helped by evicting pods from nodes of another kind.
Taints
A node that repels a pod stays off limits, no matter how many pods are removed from it.
Affinity to Victims
If a pod wants to be near a lower-priority pod, that pod will not be evicted to make room for it.
Cross-Node Plans
Preemption reasons about one node at a time, so rules spanning several nodes are not solved by combined evictions.
When a high-priority pod stays pending and no preemption seems to happen, check its own rules first. Very often the pod is asking for something that no node can provide, and the fix is to loosen the rule, not to raise the priority.
14Priority, Quality of Service, and Node Pressure
Three separate mechanisms all involve removing or favoring pods, and keeping them apart in your mind will save you from many wrong guesses.
Mechanism One: Scheduler Preemption
This is the subject of our guide. It happens at scheduling time, is driven by pod priority, and is carried out by the scheduler. Its goal is to make room for a pod that is waiting to be placed.
Mechanism Two: Node-Pressure Eviction
This one is carried out by the kubelet, the helper program that runs on every node. When a machine begins to run out of a resource such as memory or disk space, the kubelet must remove some pods to protect the machine. It chooses whom to remove in a set order: first pods whose usage is above what they requested, then among those the ones with lower priority, and then those that exceed their request by the largest amount. Notice that priority matters here too, but the trigger is entirely different. Nothing is waiting to be scheduled. The machine itself is in trouble.
Mechanism Three: Quality of Service and Memory Kills
Every pod is automatically placed in one of three quality of service classes based on how its requests and limits are written. Guaranteed pods have requests equal to limits, Burstable pods have some requests below limits, and BestEffort pods have neither. When a machine truly runs out of memory and the operating system must kill a process, these classes influence which containers are chosen first. This happens deep inside the machine, and it is separate from both of the mechanisms above.
| Question | Scheduler Preemption | Node-Pressure Eviction | Memory Kill |
|---|---|---|---|
| Who acts? | The scheduler | The kubelet | The operating system |
| What triggers it? | A pod cannot be placed | A node runs short of a resource | Memory is fully exhausted |
| What ranks the victims? | Priority value | Usage above request, then priority | Quality of service class and usage |
| Respects disruption budgets? | Best effort | No | No |
| Goal | Make room for important pods | Protect the machine | Keep the system alive |
Imagine a lifeboat. Preemption is the captain deciding who gets a seat before the boat leaves, based on rank. Node-pressure eviction is the crew asking people to lighten the load when the boat starts to sink slowly. A memory kill is the last-second act of throwing heavy cargo overboard when water floods in. All three remove things, but for different reasons and by different rules.
Giving a pod a high priority does not make it immune to node-pressure eviction or memory kills. It only helps it rank better. A pod that uses far more than it requested can still be removed from a struggling machine. The best protection is to request an honest amount of resources.
15Controlling Who May Use Which Priority
A ranking is only meaningful if not everyone can grab the top spot, so cluster owners need ways to limit access to high priority levels.
The Problem of Priority Inflation
Any person who can create a pod can name any existing priority class in it. There is no built-in rule that says only certain teams may use certain classes. If a single team discovers that the highest class exists and starts using it for everything, its pods will outrank everyone else and may evict their work. Other teams, noticing this, will do the same in self-defense. Soon every workload claims to be critical, and the ranking becomes meaningless. This is called priority inflation, and it is the most common failure of the whole feature.
Imagine a company where any employee may mark their email as urgent. At first, urgent means something. After a few weeks, every email is marked urgent, and nobody can tell the true emergencies from the ordinary requests. The marker has lost its value because it was free to use.
Quotas Scoped by Priority
Kubernetes provides a tool called a resource quota, which limits how much a namespace may consume. A quota can be scoped so that it applies only to pods of chosen priority classes. This allows an administrator to say that a given team may run at most a certain amount of processor and memory using the high priority class, and much more using the low priority class. A namespace with no quota for a class effectively cannot use it in large amounts. This turns priority from a free label into a limited budget.
Admission Rules
Many clusters also use policy tools that inspect each new pod as it is created. These tools can enforce rules such as only pods in the platform namespace may use the system classes, or pods from the analytics team may only use the batch class. Such rules give clear, automatic protection and produce a friendly message to the developer when they choose a class they are not permitted to use.
Reserve the top for the platform
The highest classes are kept for components that keep the cluster alive, and only those namespaces may use them.
Budget the middle
Business services receive a limited quota of the high class, so teams must justify what truly deserves it.
Leave the bottom open
Low classes for batch and experiments can be used freely, because misusing them harms nobody.
Make creating a PriorityClass a privilege of cluster administrators only. Anyone who can create a class with a huge number can outrank everything else, so this permission is as sensitive as it sounds.
16Designing a Priority Scheme
A good scheme is small, clear, and tied to business meaning rather than to the technical size of an application.
Fewer Levels Are Better
It is tempting to create dozens of fine-grained levels so that every application has its own exact rank. This almost always backfires. Teams argue about tiny differences, nobody remembers what each level means, and the ordering becomes brittle. A handful of levels, roughly four to six, is usually enough. Each level should have a plain-language description of who may use it and what promise it carries.
| Tier | Example Workloads | Preemption Setting | Meaning |
|---|---|---|---|
| Platform critical | Cluster networking, name lookup, node agents | May preempt | The cluster cannot work without these |
| Business critical | Customer-facing services, payment paths | May preempt | Direct revenue or customer impact if lost |
| Standard | Internal services, most everyday applications | May preempt | The normal choice for most workloads |
| Batch | Reports, data processing, training jobs | Never preempts | Valuable, but can wait and can be moved |
| Best effort or placeholder | Experiments, spare-capacity placeholders | Never preempts | Should always yield to anything else |
Leave Gaps Between Numbers
Choose numbers with wide gaps, such as one thousand, ten thousand, and one hundred thousand, instead of one, two, and three. Since the number of a class cannot be edited later, wide gaps leave room to add a new level between two existing ones without having to renumber everything. This small bit of foresight saves painful migrations later.
Handling Stateful and Long-Running Work
Not all pods are equally easy to move. A stateless web server can be stopped and started elsewhere in seconds, and nobody notices. A database that holds data on a disk attached to one machine, or a long computation that has run for ten hours without saving its progress, is far more costly to interrupt. When you design your tiers, think about how expensive it would be to lose each kind of workload at a random moment, not only how important it is.
A useful habit is to ask two questions of every workload. First, how bad is it if this pod is not running for a few minutes? Second, how much work is lost if it is stopped without warning? A workload with a high answer to either question deserves a higher tier, or at least a design that saves its state regularly, so that an eviction costs a little and not everything.
Rank by Meaning, Not by Size
A large application is not automatically a more important one. A tiny service that checks whether a payment is legitimate may deserve a higher rank than a giant reporting system. Base your tiers on what happens to the business, and to the cluster, if the workload is interrupted. This keeps the scheme fair and understandable to non-engineers too.
flowchart TD
A["New workload"] --> B{"Does the cluster fail without it?"}
B -->|"Yes"| C["Platform critical"]
B -->|"No"| D{"Does interruption hurt customers directly?"}
D -->|"Yes"| E["Business critical"]
D -->|"No"| F{"Must it run continuously?"}
F -->|"Yes"| G["Standard"]
F -->|"No"| H{"Is it valuable but patient?"}
H -->|"Yes"| I["Batch, non-preempting"]
H -->|"No"| J["Best effort"]
Set one class as the global default, and choose a modest tier for it. A cluster whose default is zero and whose tiers all sit far above it will treat forgetful teams’ pods as the least important on the cluster, which may not be what anyone intended.
17Autoscaling and the Spare Capacity Trick
Priority and preemption combine beautifully with automatic cluster growth to give important pods instant room while new machines start up.
The Slow Start of New Machines
A cluster autoscaler is a helper that adds machines when pods are pending because there is no room, and removes machines that sit mostly empty. The trouble is that starting a machine takes time, often several minutes. During that time, a newly arrived important pod sits pending. For a web service facing a sudden burst of visitors, several minutes is a very long wait.
Placeholder Pods
A clever and popular solution uses priority. The cluster owner runs a set of placeholder pods that do nothing at all except hold room. They have a very low priority, lower than every real workload, and they are usually written so that they never use much. Because they reserve resources, the cluster keeps a cushion of apparently used but really idle space.
When an important pod arrives and finds the cluster full, it preempts the placeholders. It is placed immediately on the room they held, with no waiting for new machines. The evicted placeholders, being pods managed by a controller, are recreated and go pending. That pending state is what tells the autoscaler to add a machine. So the cluster grows in the background to restore its cushion, while the important pod is already running.
sequenceDiagram
participant P as Placeholder pods
participant I as Important pod
participant S as Scheduler
participant A as Autoscaler
I->>S: New pod, cluster looks full
S->>P: Preempt placeholders
S->>I: Place on freed room at once
P->>S: Recreated and pending
S->>A: Pending pods signal need
A->>A: Add a new machine
S->>P: Placeholders placed on new machine
A restaurant on a busy night keeps a few tables marked with reserved cards that are not really reserved for anyone. When an important guest arrives, the host removes a card and seats them at once. Meanwhile, staff quietly set up another table in the back to bring the cushion back.
Sizing the Placeholder Cushion
How many placeholder pods should you run, and how large should each be? The answer depends on the burst you want to absorb. If your most important service sometimes needs ten extra pods of a certain size within a minute, the placeholders should hold at least that much room, in units the size of those pods. A placeholder that is far smaller than the pods it protects may free room that is scattered in pieces too small to use, so the important pod still cannot fit.
The cushion also has a cost, since reserved room is paid for even when unused. Start with a modest cushion, watch how often it is consumed, and adjust. If the cushion is used up and rebuilt many times a day, it may be too small. If it is never touched for weeks, it may be too large and worth trimming.
The Cutoff Detail
The autoscaler has a setting called the priority cutoff. Pods with a priority below the cutoff are considered expendable. They do not trigger the addition of new machines, and they do not stop the removal of empty ones. This is very useful for throwaway work, but it means that placeholder pods must be given a priority that is low, yet still above the cutoff, so that their pending state does prompt the cluster to grow. Getting this number wrong is the most common mistake with this trick.
If placeholder pods sit below the autoscaler’s cutoff, the cluster will never grow to replace them. The cushion will shrink after each use until it is gone. Always check the relationship between your placeholder priority and the autoscaler’s cutoff.
18Security and Safe Governance
Because priority lets one workload displace another, it is also a tool that can be abused, on purpose or by accident.
Denial of Service by Priority
A person, or a compromised application, that can freely choose a very high priority can push other workloads off machines. By creating many high-priority pods, they can evict important services and fill the cluster with their own pods. This is a form of denial of service that needs no special hacking skill. It only requires the ability to create pods and name a class. This is why access to high classes must be controlled through quotas and policy, as described earlier.
Protecting the Platform Itself
The essential parts of the cluster, such as networking and name lookup, must never be pushed out by ordinary workloads. The system classes exist for this reason, and their numbers sit above anything a user class can reach. Keep it that way. Do not create your own class with a number above the system range, and do not give ordinary applications the system classes, however tempting it may be when a team complains about being evicted.
Limit Class Creation
Only cluster administrators may create or delete priority classes, since a new class is a new power over other people’s work.
Scoped Quotas
Cap how much each namespace may consume at each priority level, so the top levels stay scarce.
Admission Policy
Automatically block pods from using classes their team is not allowed to use, with a clear explanation.
Audit and Review
Record who created classes and who used them, and review the list regularly for creeping inflation.
Multi-Team Fairness
In a cluster shared by several teams, priority can quietly turn into a political tool. Teams with more influence may win the highest levels, while quieter teams are pushed to the bottom regardless of true importance. A written policy, agreed with all teams and reviewed by leadership, keeps the process transparent. It should say who decides which workloads deserve which tier, and how a team can ask for a change.
Where teams have strongly different needs, consider giving them separate clusters or separate groups of machines instead of stretching one priority scheme across everyone. Priority is a way to share fairly, not a replacement for isolation when isolation is what you really need.
19Monitoring and Observability
You cannot manage preemption well if you cannot see it, so watching a few key signals is part of running the feature safely.
What to Watch
When a pod is preempted, Kubernetes records an event on it, and the message names the pod that caused the eviction. These events are the first place to look when someone asks why their pod disappeared. The scheduler also exposes measurements about its work, including how many preemption attempts it has made and how many victims each attempt removed. Watching these over time shows whether preemption is a rare emergency measure or an everyday occurrence.
Preemption Attempts
A rising count means the cluster is often full for important pods and may need more capacity or a better cushion.
Victims per Attempt
Many victims each time suggests very large important pods or heavily fragmented free space across nodes.
Pending Pods by Priority
Shows who is waiting and how long. High priority pods pending for long are a sign of a real problem.
Restarts of Recreated Pods
Frequent recreation of the same low-priority workloads shows that some teams are suffering from repeated evictions.
Reading a Preemption Event
When you look at the events for a preempted pod, read them like a short story. The event tells you which pod caused the eviction, on which node it happened, and roughly when. From this you can ask helpful questions. Was the preempting pod really as important as it claimed? Was the victim in a tier designed to yield? Did the victim get its full grace period? Answers to these questions turn a confusing disappearance into a learning moment and often reveal a small design flaw, such as a workload that sits one tier too low.
It also helps to keep a simple log of notable preemptions in a shared place. Patterns emerge quickly. You may notice that the same batch job is evicted every Monday morning when a weekly sale begins, which suggests either moving the job or adding capacity for that hour.
Alerts That Help
Useful alerts are few and meaningful. One alert can fire when a high-priority pod remains pending beyond a set time. Another can fire when the number of preemptions in an hour rises far above the usual level. A third can warn when a namespace uses more of a top tier than its budget expects. Each alert should link to a short guide that explains what the alert means and what the first checks are.
A restaurant manager who never looks at how often guests are moved from table to table will not notice that the room is chronically too small. Counting the moves, even roughly, tells the manager whether to buy more tables, change the reservation policy, or simply relax.
Show the priority class of each pod on your dashboards. Without it, all evictions look alike, and you cannot tell whether a spike is harmless placeholder churn or dangerous loss of business services.
20Troubleshooting Priority Problems
A short list of common symptoms and their usual causes will resolve most confusing situations quickly.
Most problems with priority fall into a few families. Either a pod is not getting its expected level, or preemption is not happening when it should, or it is happening more than it should. Work through the likely causes calmly, starting with the simplest ones: does the pod really have the class you think it has, and is the number what you expect?
| Symptom | Likely Cause | What To Check |
|---|---|---|
| Pod rejected at creation | The named class does not exist | Spelling of the class name and whether it was deleted |
| Pod has priority zero unexpectedly | No class named and no default class defined | Whether a global default class exists and when it was created |
| High priority pod pending, nobody evicted | Blocked by rules such as labels, taints, or affinity | The pod’s own placement rules and node conditions |
| High priority pod pending with a nominated node | Victims are still shutting down | Grace periods of victims and whether they exit cleanly |
| Same pods evicted again and again | They sit at the bottom while capacity stays short | Capacity, placeholder sizing, and autoscaler behavior |
| Important service loses several pods together | Preemption broke a disruption budget as a last resort | Priority of the service and spread of its replicas |
| Cluster never grows for pending pods | Pods are below the autoscaler’s priority cutoff | Cutoff value against the pods’ priority |
| Class change has no effect on running pods | Priority is stamped at creation | Whether pods were recreated after the change |
A Calm Order of Investigation
First confirm the facts: which class, which number, which state. Second confirm that the pod could fit in principle, ignoring other pods entirely. If it cannot fit even on an empty machine, no priority will help. Third look at the events on the pod and on the victims, which usually tell the story in plain words. Only then consider changing priorities or capacity. Changing settings before understanding the cause usually makes things worse.
Raising a stuck pod to a higher priority is tempting, but it only moves the pain to someone else, who now gets evicted instead. If the real cause is too little capacity or a placement rule that cannot be met, raising the priority only creates a second problem.
21Priority Compared With Other Scheduling Tools
Priority is one of several ways to influence where pods run, and each tool answers a different question.
Beginners sometimes reach for priority when another tool would fit better. It helps to see them side by side. Each tool has a purpose, and using the right one keeps your setup simple and predictable.
| Tool | Question It Answers | Typical Use |
|---|---|---|
| Priority and preemption | Who wins when room is short? | Ranking critical, standard, and batch work |
| Node selectors and node affinity | Which kinds of nodes may this pod use? | Placing work on machines with special hardware |
| Taints and tolerations | Which pods may use this reserved node? | Keeping special machines for special workloads |
| Pod affinity and anti-affinity | Which pods should be near or far from each other? | Spreading replicas or grouping chatty services |
| Resource requests and limits | How much does this pod need and may it use? | Honest sizing and fair sharing on a machine |
| Resource quotas | How much may this team consume in total? | Budgeting a namespace |
| Disruption budgets | How many pods may be down at once? | Safe maintenance of a service |
Using Them Together
These tools are complementary. A well-run cluster might use taints to keep expensive machines for machine-learning jobs, quotas to limit each team’s consumption, requests and limits to size pods honestly, disruption budgets to keep services healthy during maintenance, and priority to decide who yields when everything is full. Each layer handles a different concern, and together they give a predictable, fair, and safe cluster.
Running a hotel involves many separate rules: which rooms are for which guests, how many rooms each tour group may book, how long housekeeping may disturb a room, and who gets bumped when the hotel is overbooked. Priority is only the overbooking rule. The others handle different questions.
If your problem is where a pod may run, use placement rules. If your problem is how much a team may use, use quotas. If your problem is who yields when room is short, use priority. Matching the tool to the question keeps everything simpler.
22Advantages and Trade-offs
Every capability has a price, and honest teams look at both sides before turning it on widely.
Advantages
- Critical workloads get room first, even in a crowded cluster
- Lets many kinds of work share one cluster, which saves money
- Gives a clear, explainable ranking that teams can discuss and agree on
- Works together with autoscaling to give instant room through placeholders
- Non-preempting option lets important batch work queue politely
- Built into Kubernetes, so no extra tools are needed
Disadvantages / Trade-offs
- Preemption disrupts real work, causing failed requests and lost state
- Low priority pods can be starved by a steady flow of higher ones
- Priority inflation makes the ranking useless if access is not controlled
- Disruption budgets are only best effort during preemption
- The scheduler cannot solve rules that span many nodes by combining evictions
- Changing the design later is slow, since numbers are fixed at creation
When It May Not Be Worth It
A small cluster that runs a single application, or a cluster with so much spare room that pods are never pending, gains little from priority. Adding a ranking there only adds something to explain and maintain. Priority becomes truly valuable when the cluster is shared, the budget is tight, and the difference in importance between workloads is large.
A tiny cafe with ten seats and never more than six customers does not need a reservation system. A busy restaurant with a two-hour wait absolutely does. Priority is the reservation system of the cluster, and it pays off only when demand can exceed supply.
The safest way to adopt priority is gradually. Start with a small set of levels, observe how often preemption happens, and expand only when the evidence shows a real need.
23Best Practices and Common Mistakes
Teams that use priority well follow the same habits, and teams that struggle repeat the same mistakes.
Habits That Work
Keep the number of levels small
Four to six clearly described tiers are easier to understand, explain, and defend than dozens of fine-grained ranks.
Set a sensible global default
Choose a modest tier as the default so forgetful teams land in a reasonable place instead of accidentally at the very bottom or top.
Request honest resources
Accurate requests make scheduling and preemption predictable. Pods that lie about their needs cause confusing evictions and wasted space.
Run several replicas across nodes
Spreading copies means that a single preemption removes only part of a service, and the rest keeps answering customers.
Design workloads to be interrupted
Low-priority work should save its progress and shut down cleanly, so being moved costs little.
Mistakes to Avoid
Problem
Every team is allowed to choose the highest business tier for all of its applications, and soon nearly every workload is marked as critical.
Why It’s Harmful
With everyone at the top, the ranking says nothing. Preemption then lands on random victims, and true emergencies lose their advantage.
Correct Approach
Limit each namespace’s use of the top tiers with scoped quotas, and ask teams to justify what truly belongs there.
Problem
A database that keeps important data on a single machine is given a low priority to keep it out of the way of other workloads.
Why It’s Harmful
It becomes a natural victim when room is short. Being evicted may cause a long recovery and service outages for everything that depends on it.
Correct Approach
Give stateful, hard-to-move workloads a higher tier than easily replaced ones, and pair them with replicas and disruption budgets.
Problem
Priority is used as the only answer to a chronic shortage of capacity, so the cluster is run permanently full and constantly evicting lower pods.
Why It’s Harmful
Lower-tier teams suffer constant disruption and lose trust, while the real problem, too little capacity, is never solved.
Correct Approach
Use priority to handle short bursts and shortages, and add capacity, or tighten quotas, when preemption becomes a daily event.
24Real-World and Industry Examples
Priority and preemption appear, in some form, in almost every mature shared cluster, and the patterns repeat across industries.
Platform components on managed clusters
Managed Kubernetes services commonly run their own add-ons, such as name lookup, networking, and monitoring agents, with the built-in system classes so that ordinary user workloads cannot push them out.
Online retail during sales
Shops with sudden bursts of traffic keep checkout and payment services in a high tier, while recommendation refreshes and reports sit lower. When a sale starts, the important paths get room first.
Machine-learning platforms
Teams training models often use a non-preempting batch class so long jobs are placed ahead of casual experiments without disrupting running production services.
Financial and payment systems
Where a lost transaction has direct cost, the services in the payment path get a top business tier, with several replicas and disruption budgets as extra protection.
Shared internal platforms
Platform teams that host dozens of product teams offer a small menu of tiers with quotas, so each team gets clear rules and nobody can claim the whole cluster.
Cost-conscious clusters with spare capacity placeholders
Organizations that want fast scaling without keeping many idle machines use low-priority placeholder pods, so new important pods start at once while the autoscaler quietly adds machines.
You do not need a giant company to benefit. Even a small team sharing one cluster between a customer-facing service and a nightly job gains real safety from a two-tier setup that keeps the service safe and lets the job wait.
25A Roadmap for Adopting Priority Safely
Nobody needs a perfect design on day one, so here is a gentle path from a first experiment to a confident practice.
It is tempting to design the perfect scheme in a meeting room and switch it on everywhere at once. Teams that do this often discover surprises in production. A staged approach, growing in steps, lets you learn how preemption behaves in your own cluster before it matters most.
Observe first
Before changing anything, measure how often pods are pending and why. Learn whether shortages are frequent or rare.
Define a few tiers
Create a small set of classes with wide gaps between numbers, clear descriptions, and a modest global default.
Protect the platform and the top
Give essential platform components their system classes, and add quotas and policies so the upper tiers stay scarce.
Move workloads gradually
Assign classes to a few important services and a few batch jobs first. Watch the effect on events and dashboards.
Add spare capacity placeholders
When the basics are calm, introduce low-priority placeholders and confirm they work with your autoscaler’s cutoff.
Review regularly
Every few months, look at who uses which tier, how often preemption occurs, and whether the descriptions still match reality.
A Practical Checklist
Tiers and Defaults
Few tiers, wide gaps in numbers, a modest global default, and plain descriptions of who may use each.
Access Controls
Only administrators create classes, quotas limit the top tiers, and policies block wrong choices automatically.
Workloads
Honest requests, several replicas across nodes, disruption budgets, and clean, quick shutdown behavior.
Signals
Events, preemption counts, pending time by tier, and dashboards that show the class of every pod.
26Frequently Asked Questions
No. Priority is a number that ranks pods for scheduling and preemption. Quality of service classes describe how a pod’s requests and limits relate, and they influence which pods suffer first when a machine runs out of memory. They are related in spirit but controlled by different parts of the system.
No. Preemption is a last resort. If any node can hold the pod, the pod goes there and nobody is evicted.
No. Only pods with strictly lower priority can be victims. Equal priority pods never evict each other.
It is shut down politely using its grace period. If a controller such as a deployment manages it, a replacement is created and waits in the queue at its own lower priority. A pod with no controller is simply gone.
No. The scheduler tries to respect them but may break them if there is no other way to make room.
The exact number matters less than the ordering. Choose a small set of well-spaced levels, keep user-defined values below one billion, and leave the highest system classes for the cluster’s own essential components.
No. The value cannot be edited after creation. Create a new class with the new value and move your workloads to it.
No. Priority affects where and whether a pod is placed, not how much processor it gets once running. Processor sharing on a machine is controlled by requests and limits.
Victims need time to shut down gracefully, so the pod waits during their grace period. If the wait is much longer, look at victims that refuse to exit, rules that prevent the pod from fitting on the nominated node, or other pods that arrived with even higher priority.
No. If everyone can pick the top level, the ranking loses its meaning. Use permissions and quotas to control who may use which classes.
27Summary and Key Takeaways
Pod priority and preemption give a Kubernetes cluster a way to decide, in a principled manner, what matters most when there is not enough room for everything. Priority is a number, delivered through named classes, that orders the waiting line. Preemption is the fallback in which the scheduler carefully removes the smallest, least important set of pods to make space for a more important one. Around these two ideas sit important gentle features, such as the non-preempting setting, disruption budgets, and the nominated node that reserves freed space.
The technology is easy to describe and easy to misuse. A good design uses only a few clearly named levels, reserves the highest ones for the cluster’s own essential parts, protects who may use what, and keeps a close eye on how often preemption actually happens. Done well, it lets a cluster serve both critical and casual work without wasting money on idle spare machines.
Key Takeaways
- Priority is a ranking — a number delivered through a named class that orders waiting pods and decides who may evict whom.
- Preemption is a last resort — it happens only when no node can hold a pod, and only lower-priority pods can be removed.
- Victims are chosen gently — the scheduler prefers the fewest, least important victims and tries to spare everything else.
- Nomination is a hint — the nominated node reserves freed space during the shutdown gap, but the pod may still end up elsewhere.
- Never means polite — the non-preempting policy lets work jump the queue without evicting anyone.
- Budgets are best effort — disruption budgets guide preemption but can be broken when no alternative exists.
- Design with few levels — use a small set of clear tiers, control who can use them, and reserve system classes for the platform itself.