thinQmaster Virtual testing partner Adaptive practice exams that find your weak spots and drill them. Every answer explained. From $69
Enroll

thinQmaster

Find your exam

Five questions free, before you decide.

Step 1 · choose a vendor

In one of our camps? Your practice exams come with the tuition — they are on your study page already.

DevOps & Automation · Intermediate

Node Affinity

Kubernetes rules that constrain which nodes a pod can be scheduled on based on node labels.

Definition

requiredDuringSchedulingIgnoredDuringExecution is a hard rule; preferredDuringScheduling... is soft. nodeSelector is a simpler equality-only alternative. Pod affinity and anti-affinity place pods relative to other pods, for example spreading replicas across zones.

Example

Require nodes labeled disktype=ssd for a database pod.

Exam tip

Pod anti-affinity or topologySpreadConstraints spread replicas across nodes and zones for HA.

Related terms