Assigning Pods to Nodes (Affinity/ Anti-Affinity)
Node Affinity allows you to constrain which nodes your pods are eligible to be scheduled on based on labels that have been defined for the nodes. There are two types of node affinity that are used with OneDB.
-
requiredDuringSchedulingIgnoredDuringExecution
-
preferredDuringSchedulingIgnoredDuringExecution
requiredDuringSchedulingIgnoredDuringExecution: This is a hard requirement in that the pod “must” be scheduled on the node with the defined set of rules.
preferredDuringSchedulingIgnonredDuringExecution: This is a soft requirement in that the pod will prefer or try to schedule on nodes with the defined rules but it is not guaranteed.
-
requiredDuringSchedulingIgnoredDuringExecution
-
preferredDuringSchedulingIgnoredDuringExecution
requiredDuringSchedulingIgnoredDuringExecution: This is a hard requirement in that the pod “must” be scheduled on the node with the defined set of rules.
preferredDuringSchedulingIgnonredDuringExecution: This is a soft requirement in that the pod will prefer or try to schedule on nodes with the defined rules but it is not guaranteed.