How the scheduler works
How kube-scheduler picks a node for a pod: filtering, scoring, binding, and how to influence it.
Transcript
When you create a pod, it has no node yet. The scheduler watches for these unassigned pods.
For each pod, it first filters out the nodes that cannot run it: not enough CPU or memory, or a taint the pod does not tolerate.
Then it scores the remaining nodes, preferring those with more free resources.
The pod goes to the highest score. The scheduler only writes the node name into the pod. The kubelet does the rest.
You can guide it with resource requests, node selectors, affinity rules, and taints and tolerations.
Filter. Score. Bind.
More in this series
1:30Inside Kubernetes
The control plane and the nodes: API server, etcd, scheduler, controllers and kubelet, and how a pod gets created.
1:30What does etcd do?
etcd as the Kubernetes database: keys, leader election, Raft quorum, watches and backups.
1:21Controllers and reconciliation
The control loop at the heart of Kubernetes: desired vs actual state, Deployments, ReplicaSets and the kubelet.