Scheduling in Kubernetes
We’ve already touched the surface of what Kubernetes scheduler (kube-scheduler
) does in Chapter 5. The scheduler is the component of the K8s control plane that decides on which node a pod will run.
Scheduling
Scheduling is the process of assigning Pods to Kubernetes nodes for the kubelet to run them. The scheduler watches for newly created Pods that have no node assigned in an infinite loop, and for every Pod it discovers, it will be responsible for finding the optimal node to run it on.
The default kube-scheduler
scheduler selects a node for a pod in two stages:
- Filtering: The first stage is where the scheduler determines the set of nodes where it is feasible to run the pod. This includes checks for nodes to have sufficient capacity and other requirements for a particular pod. This list might be empty if there are no suitable nodes in the cluster, and in such a case, the pod will hang in an unscheduled state until either the requirements...