Day 4, writing about the Kubernetes Scheduler!
The Kubernetes scheduler is responsible for deciding which pods go on which nodes - it doesn't place the pods on the nodes but it notes which node a pod should go on. The Kubelet is the actual agent that is responsible for creating pods on the nodes.
The Scheduler is for ensuring that the right pods end up on the right notes - in the previous analogy with the ships, there are different sizes of ships and different destinations to which the ships are directed, and the containers have different sizes as well. The kube scheduler looks at each pod and finds the best fit node for the pod.
There are two phases to this -
The first is the scheduler will filter out the nodes that do not fit the profile for the pod - it may be marked to not go on a specific node or it may not have the resources to support the resources the pod requires.
The second is it creates a priority function to assign a score to the nodes on a scale of 1-10 and schedules the pod on the most suited one.
These values can be customised, and you can write your own scheduler as well.
Some determinants for this are resource requirements/requests and limits, taints and tolerations, node selectors, affinity rules, etc.
To install the kube scheduler, you can download the kube scheduler binary from the kubernetes release page, extract it and run it as a service. When you run it as a service, you specify the scheduler config file.
To view the kube scheduler, you have the option to find the kube scheduler as a pod in the kube-system namespace if you deployed it with the kubeadm tool - the pod definition file exists in the /etc/kubernetes/manifests file, or you can do a process search using ps -aux | grep kube-scheduler
That's all I have for today!
-Catt
Top comments (0)