In this section, we will make sure that pods are not scheduled onto inappropriate nodes. You will learn how to schedule pods into Kubernetes nodes using node selectors, taints, toleration and by setting priorities.
Getting ready
Make sure you have a Kubernetes cluster ready and kubectl and helm configured to manage the cluster resources.
How to do it…
This section is further divided into the following subsections to make this process easier:
- Labeling nodes
- Assigning pods to nodes using nodeSelector
- Assigning pods to nodes using node and inter-pod affinity
Labeling nodes
Kubernetes labels are used for specifying the important attributes of resources that can be used to apply organizational structures onto system objects. In this recipe, we will learn about the common labels that are used for Kubernetes nodes and apply a custom label to be used when scheduling pods into nodes.
Let's perform the following steps to list some of the default labels...