To schedule Pods on nodes with specific properties, Kubernetes gives you a few possible options:
- Using nodeName in the Pod specification. This is the simplest form of statically scheduling Pods on a given node and is generally not recommended.
- Using nodeSelector in the pod specification. This gives you the possibility to schedule your pod only on nodes that have certain label values. We have been already using this approach in the previous section.
- Node affinity and anti-affinity: These concepts expand the nodeSelector approach and provide a richer language of defining which nodes are preferred or avoided for your pod. You can read more about the possibilities in the official documentation: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#affinity-and-anti-affinity.
- Node taints and pod tolerations: They provide an opposite functionality...