Process Flow - Pod affinity and anti-affinity
Pod Scheduling Request
Check Pod Affinity Rules
Match Affinity
Check Pod Anti-Affinity Rules
Reject Node
Pod Scheduled on Node
When Kubernetes schedules a pod, it checks affinity and anti-affinity rules to decide which node is suitable. Affinity prefers nodes with matching pods; anti-affinity avoids nodes with certain pods.