IT lexicon › Infra & Ops › Node affinity

Node affinity

Infra & Ops På svenska → Updated: 2026-05-27

Kubernetes feature: control which nodes a pod is scheduled on based on node labels. requiredDuringSchedulingIgnoredDuringExecution = hard rule, preferred = soft.

Use: schedule ML workloads on GPU nodes (nvidia.com/gpu.product=H100), high-memory pods on r5.xlarge instances, geographic placement (eu-west zones). Newer: Topology Spread Constraints — spread pods evenly across zones/nodes for HA. Anti-affinity: avoid scheduling pods from the same deployment on the same node (for disaster resilience). Classic trap: required affinity that can't be satisfied → pod hangs in Pending forever. Use preferred for soft requirements, required only when absolutely necessary.

← Back to the lexicon