Debug Kubernetes Scheduling: troubleshooting commands
11 commands in 3 groups: Pending Pods, Constraints Inspection, Pod Placement. Click or tap any command to copy it. Official documentation: kubernetes.io.
Open in the interactive cheat sheet search, stars and every other section
Pending Pods
Find pods stuck Pending and read scheduler events that explain why they cannot be placed.
kubectl get events --field-selector=reason=FailedScheduling
Scheduling failure events in current namespace
kubectl get pods --field-selector=status.phase=Pending
Find Pending pods in current namespace
kubectl get pods --field-selector=status.phase=Pending -A
Pending pods across all namespaces
kubectl get events --field-selector=reason=FailedScheduling -A --sort-by='.metadata.creationTimestamp'
Recent scheduling failures cluster-wide
Constraints Inspection
Read taints on nodes and tolerations, nodeSelector and affinity rules on pods to spot mismatches.
kubectl get nodes -o jsonpath='{range .items[*]}{.metadata.name}{"\t"}{.spec.taints}{"\n"}{end}'
Tab-separated taints per node
kubectl get pod <name> -o jsonpath='{.spec.affinity}'
Pod affinity / anti-affinity rules
kubectl get pod <name> -o jsonpath='{.spec.nodeSelector}'
Pod nodeSelector keys/values
kubectl get pod <name> -o jsonpath='{.spec.tolerations}'
Tolerations the pod is willing to accept
Pod Placement
See where pods actually run and find uneven placement or unexpected nodes.
kubectl get pods -o wide --field-selector=spec.nodeName=<node>
All pods on a specific node in current namespace
kubectl get pods -o wide --sort-by='{.spec.nodeName}'
Pods sorted by node name to spot uneven placement
kubectl get pods -A -o wide --field-selector=spec.nodeName=<node>
All pods on a node across all namespaces