Resource Requests and Scheduling · CKA
If a Pod is Pending despite seemingly spare resources, start by checking requests.
Learn with progress and quizzesFirst, understand the concepts.
Requests and limits
The scheduler considers resource requests and the node’s allocatable resources. Limits cap resource use at runtime and serve a different purpose.
Placement constraints
nodeSelector, affinity, and taints/tolerations also affect placement. A toleration permits a matching taint; it does not force the Pod onto that node.
Why it matters
A node with low CPU utilization may still reject a Pod requesting two CPUs. Compare existing requests with allocatable capacity rather than looking only at utilization.
Work through the reasoning
Calculate available requests
With four allocatable CPUs and three CPUs already requested, a simple single-container two-CPU request does not fit the remaining one. 500m means half a CPU. Record reserved and observed usage separately.
Check placement constraints
If CPU and memory fit, inspect nodeSelector, affinity, and taints. A toleration permits a taint; it neither satisfies other constraints nor forces placement on that node.
Learn by doing.
You need kubectl and access to your own practice Kubernetes cluster. Each lab is independent. Check your current context first, then run the commands in your own terminal.
Inspect allocatable and already requested resources on nodes, along with their taints and labels.
kubectl get nodes --show-labels
kubectl describe nodes
kubectl get pods -A --field-selector=status.phase=PendingHow to check your result
Find Allocated resources and Taints. If a Pod is Pending, inspect its describe output for FailedScheduling events.
Apply what you learned
Can a 600m request fit a node with 2 CPUs allocatable and 1500m already requested? Would lowering only the limit help?
Reveal the reasoning after trying
In this simplified example only 500m remains, so it does not fit. Changing only the limit leaves the scheduling request unchanged. Adjust requests using actual requirements or provide capacity.
Ready to check your understanding?
What does the scheduler use to assess a Pod’s CPU and memory requirements?
- Only current CPU utilization
- Container image size
- requests
- Number of log entries
Reveal the reasoning after trying
requests
Placement decisions use requests. Low actual usage alone does not mean a Pod can be scheduled.