TECHNOLOGY

Keep required node affinity satisfiable after relabeling

In this article
THE QUICK TAKE

Required affinity can block replacements after relabeling without evicting existing Pods; test current placement feasibility explicitly.

After node labels change, old model replicas keep running while replacement Pods cannot be scheduled. requiredDuringSchedulingIgnoredDuringExecution explains this difference. The rule is enforced for placement, while a later label change does not by itself evict an already placed Pod under that affinity type.

Capture old and incoming constraints

Read the template for new Pods and the actual labels on candidate nodes. Preserve the still-running Pod’s node binding and creation context separately. Its continued existence is not proof that the current label set still satisfies the incoming template. A label rename can therefore surface only when maintenance or a failure requires replacement.

Evaluate the boolean structure

Required node-affinity terms can represent alternatives, while expressions within a term combine under the documented rules. nodeSelector can add another simultaneous requirement. A visually plausible list is not enough; evaluate the effective combination against real node labels. One unexpected conjunction can eliminate every GPU node without changing resource availability.

Keep hardware claims trustworthy

A scheduling label describes a property the cluster intends to use. Changing it does not change physical accelerator capability or installed software. Confirm the underlying inventory before relabeling to make a Pod fit. Otherwise the scheduler can accept a node that cannot actually load the model or support its required runtime.

Decide how existing replicas should transition

IgnoredDuringExecution should not be mistaken for an automatic migration policy. If existing replicas must leave nodes after a classification change, the application needs a separate authorized rollout or lifecycle decision. Account for spare capacity and readiness. A label edit alone does not supply a safe evacuation plan.

Test recreation before maintenance

In an isolated fixture, change a synthetic label and compare an existing Pod with a newly created equivalent. Verify the expected continued execution and failed or successful placement. Acceptance means the current template remains satisfiable on genuinely compatible hardware and the old/new distinction is understood. It does not guarantee immediate movement, physical compatibility from labels alone or enough model-ready capacity during replacement.

Primary references

Assigning Pods to Nodes.

Kubernetes Labels and Selectors.

Kubernetes Pod Lifecycle.

Related reading: GPUs in Kubernetes: scheduling CPU, RAM and accelerators together; Updating an LLM on a GPU: testing a new version with a small rollout.

Earn rental income from GPUs

Have idle GPUs or looking to fund AI infrastructure? Retrivium finds a rental platform, sets up the server and helps you assess income and costs with a pilot.

Explore GPU hosting
← All articles