Scheduling and scaling, topic 34 of 61
Node selection and affinity
nodeSelector limits a Pod to nodes with given labels, such as a GPU type. Node affinity says the same with more operators, and can be a preference rather than a rule.
Pod affinity places a Pod near Pods with given labels, such as a cache beside its app; Pod anti-affinity keeps it away from them, such as two replicas never on one node. Required rules can leave Pods Pending when nothing fits, so prefer preferences unless you mean it.
On Opsfolk
- CKA practice: Advanced Kubernetes administrationQuiz, 40 questionsSigned-in members
Elsewhere
- Assigning Pods to nodesOfficial