- What is pod anti-affinity rules?
- What is the difference between pod affinity and pod anti-affinity?
- What is affinity rule in Kubernetes?
- What is node anti-affinity in Kubernetes?
What is pod anti-affinity rules?
The pod anti-affinity rule says that the pod prefers to not schedule onto a node if that node is already running a pod with label having key security and value S2 .
What is the difference between pod affinity and pod anti-affinity?
The pod affinity rule ensures that pods will only get scheduled to a node with at least a single pod with the matching key-value pair app-name: web-app . Meanwhile, the anti-affinity rule will try to keep pods from getting scheduled on nodes with containers with the key-value pair type: frontend .
What is affinity rule in Kubernetes?
Node affinity is conceptually similar to nodeSelector , allowing you to constrain which nodes your Pod can be scheduled on based on node labels. There are two types of node affinity: requiredDuringSchedulingIgnoredDuringExecution : The scheduler can't schedule the Pod unless the rule is met.
What is node anti-affinity in Kubernetes?
An anti-affinity rule tells the scheduler not to place the new pod on the same node if the label on the new pod matches the label on another pod. Anti-affinity allows you to keep pods away from each other.