Kube Scheduler in Kubernetes
The Kube Scheduler is a Control Plane component responsible for deciding which node should run a Pod.
The scheduler makes the placement decision; the Kubelet on the selected node actually creates and runs the Pod.
Basic Flow
Pod created
↓
Kube API Server
↓
Kube Scheduler
↓
Selects the best node
↓
Kube API Server
↓
Kubelet on selected node
↓
Pod runs
How Scheduling Works
When multiple nodes are available, the scheduler evaluates each node using two main phases:
1. Filtering
The scheduler first eliminates nodes that cannot run the and doesn’t meet the pod’s resource requirements..
For example:
Pod requires: 10 CPUs
Node A → 4 CPUs ❌
Node B → 12 CPUs ✅
Node C → 16 CPUs ✅
Nodes without sufficient resources or that don’t meet the Pod’s requirements are filtered out.
2. Ranking
After filtering, the scheduler scores the remaining nodes and selects the best one.
Node B → Score: 6
Node C → Score: 10 ← Selected
The scheduler uses priority functions to compare candidate nodes and choose the best match.
Scheduling Criteria
The scheduler can consider different requirements, including:
- CPU and memory availability
- Resource limits
- Taints and tolerations
- Node selectors
- Affinity rules
Scheduling is also customizable, and Kubernetes supports developing custom schedulers.
Kubeadm Deployment
With kubeadm, the scheduler runs as a Pod in the kube-system namespace.
View the scheduler Pod:
kubectl get pods -n kube-system
View its manifest:
cat /etc/kubernetes/manifests/kube-scheduler.yaml
Check the running process and its options:
ps -aux | grep kube-scheduler
Example:
kube-scheduler \
--address=127.0.0.1 \
--kubeconfig=/etc/kubernetes/scheduler.conf \
--leader-elect=true
Quick Summary
| Component | Responsibility |
|---|---|
| Kube Scheduler | Decides which node should run a Pod |
| Filtering | Removes unsuitable nodes |
| Ranking | Scores remaining nodes |
| Kubelet | Actually creates/runs the Pod on the selected node |
| API Server | Coordinates communication between components |
Key Takeaway
Kube Scheduler = Pod placement decision-maker.
It filters unsuitable nodes, ranks the remaining candidates, and selects the best node for the Pod.