LAB 02 · EASY · 5–10 MIN
Pending Forever
The pod never schedules. There is capacity on the node, but the scheduler keeps saying no.
Goal: Schedule the workload onto a node tainted
breakfix=special:NoSchedule.Setup
kubectl get nodes
kubectl label node <NODE> breakfix-target=yes
kubectl taint node <NODE> breakfix=special:NoSchedule
kubectl apply -f broken.yamlHint 1
A Pending pod is a scheduler problem until proven otherwise. Read Events.
Hint 2
Capacity is not the only scheduler predicate. Inspect the target node's taints.
Solution
kubectl get pods -n breakfix-02
kubectl describe pod -n breakfix-02 -l app=worker
kubectl describe node <NODE> | sed -n '/Taints:/,/Unschedulable:/p'The node has a NoSchedule taint and the pod has no matching toleration. Capacity is irrelevant until the scheduler is allowed to put the workload there.
Add a matching toleration to the pod template. Do not remove a production taint just to make one workload shut up.
tolerations:
- key: breakfix
operator: Equal
value: special
effect: NoScheduleVerify with kubectl get pods -n breakfix-02 -o wide.
Keep this: Pending is a scheduler symptom, not a generic Kubernetes mood. Read Events first.