Cluster operationsLesson 1 of 16
Which Node Gets the Pod (Scheduling)
A web pod and a GPU job pod arrive in a cluster with three nodes. Let's see which nodes the scheduler rules out, which one it picks, and what happens when there is nowhere to go.
Pod to placeweb-1
Candidates left3
Result—
RequestWatchAppears in a later step
What you will learn
- Free capacity is the sum of requests, not real usage
- Taint means "keep out", node selector means "come here"
- Why anti-affinity spreads one app across nodes
- How to read a Pending message by cause
Placement rules at a glance
| Rule | Direction | What it does | Example |
|---|---|---|---|
Requests (requests) | Scheduler filters nodes | Drops nodes without room for the summed requests | Requests 1 CPU core → node with 0.5 free is excluded |
| Taints · tolerations | Node filters pods | Accepts only pods that tolerate the mark | Keep regular pods off GPU nodes |
| Node selector · node affinity | Pod chooses nodes | Goes only to nodes with matching labels | Only nodes with gpu: "true" |
| Pod anti-affinity | Pod avoids other pods | Puts replicas of the same app on different nodes | One web replica per node |
Try it yourself
kubectl describe pod <pod> # Events: 0/3 nodes are available: ...
kubectl describe node <node> | grep -A 8 'Allocated resources' # Sum of requests, not usage
kubectl get nodes -o custom-columns=NAME:.metadata.name,TAINTS:.spec.taints # Node taints
kubectl get nodes --show-labels # Labels a nodeSelector matches
kubectl get pods -o wide # Which node each replica landed on
Check yourself
Further reading: Kubernetes Scheduler · Assigning Pods to Nodes · Taints and Tolerations