Skip to content
Latchkey

What Is Node Affinity?

Node affinity is a set of scheduling constraints that express which nodes a pod prefers or requires, based on node labels. Rules can be hard, meaning the pod will not schedule without a match, or soft, meaning the scheduler tries to honor them but proceeds otherwise. It is the label-driven successor to simple node selectors.

Why it matters

Node affinity steers workloads onto the right hardware or availability zone, for example pinning a job to nodes with a specific CPU architecture. Soft rules let teams express preferences without risking unschedulable pods.

Related guides

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →