Kubernetes · Concept
Node affinity
Node affinity lets you control Pod placement using node labels. Required rules restrict scheduling; preferred rules influence placement without making a match mandatory.
Last updated
Syntax
spec.affinity.nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms: []
preferredDuringSchedulingIgnoredDuringExecution:
- weight: 1
preference: {}In-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.
SubscribeRelated
nodeSelectorpodAffinitypodAntiAffinitynodeNamePod topology spread constraintstaints and tolerations