Ceci Ivanov:
Hello friends, anyone want to revision in one thread some recap about Scheduling pods on specific nodes. I have concluded those tips:
• If there are taints applied on nodes, we must use always a toleration on the pod in case that we want to be able to schedule it on that node. However, a toleration only doesn’t ensures that the pod will be scheduled on that specific node. If we apply a nodeSelector too to that pod then that pod will be scheduled on the node. Or another way is to taint the other nodes with other labels and then the pod will have no anywhere else to go except the node with the taint that its tolerated
• NodeSelector works as a soft preference( meaning that applying only a nodeSelector doesn’t ensure that the pod will be scheduled on that node)
• If we want a hard preference we use nodeAffinity (with requiredDuringSchedulingIgnoredDuringExecution) and with that and only that the pod will be scheduled to the specific node we want
• If we want to prevent of a node containing two or more same pods we use podAntiAffinity, or if we want to ensure that a pod is scheduled always on a node that has other specific pod we use podAffinity
• Combination of nodeSelector and affinity rules i think it’s useless because the affinity is like the nodeSelector but just with more options and option for hard/soft preference
If i am making some wrong assumption here please tell me! thanks