pod-pending-debug
Skill235 starsChanged 6 months agoApache-2.0View on GitHub
Diagnose pod scheduling failures (Pending, Unschedulable). Checks events, node resources, taints, affinity, and PVC bindings to identify why a pod cannot be scheduled.
In this repository30 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- kbc/CLAUDE.mdCLAUDE.md
- cluster-eventsSkill
- deployment-rollout-debugSkill
- dns-debugSkill
- gateway-diagnosticsSkill
- hpa-debugSkill
- http-log-statsSkill
- image-pull-debugSkill
- ingress-debugSkill
- job-debugSkill
- networkpolicy-debugSkill
- node-health-checkSkill
- node-logsSkill
- pod-crash-debugSkill
- pvc-debugSkill
- quota-debugSkill
- service-debugSkill
- statefulset-debugSkill
- volcano-diagnose-podSkill
- volcano-gang-schedulingSkill
- volcano-job-diagnoseSkill
- volcano-node-resourcesSkill
- volcano-queue-diagnoseSkill
- volcano-resource-insufficientSkill
- volcano-scheduler-configSkill
- volcano-scheduler-logsSkill
- manage-skillSkill
- skill-authoringSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
13 rules. About 0 are common, 8 are distinctive, and 5 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈8
Distinctive · estimate
This author's own choices. Worth a look.
5
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 10
When a pod is stuck in Pending state, follow this flow to identify why the scheduler cannot place it on a node.
- Very specific: line 41
Use the pod's own PodScheduled condition to tell them apart — it is part of the object, so it does not expire.
- Distinctive: line 47
If the message names a specific node, read that node the same way:
- Distinctive: line 64
No node has enough allocatable CPU or memory to satisfy the pod's resource requests.
- Distinctive: line 66
Check node resource usage:
- Distinctive: line 72
Check what the pod is requesting:
- Distinctive: line 86
Check the pod's node selection criteria:
- Distinctive: line 93
Check available node labels:
- Distinctive: line 113
Check the pod's tolerations:
- Very specific: line 133
If the PVC exists but is Pending, check its events:
- Distinctive: line 145
Every node in the cluster was rejected.
- Very specific: line 177
If no FailedScheduling event exists, the pod may not have been processed by the scheduler yet — check if the scheduler pod itself is …
- Very specific: line 179
If the pod has a scheduling.volcano.sh/pod-group annotation, it is managed by Volcano scheduler — use volcano-diagnose-pod skill instead …
≈ “Common” is an estimate: at least 1 in 5 of the 213,895 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Pod Scheduling Failure Diagnosis
When a pod is stuck in Pending state, follow this flow to identify why the scheduler cannot place it on a node.
Scope: This skill is for diagnosis only. Once you identify the root cause, report it to the user and stop. Do NOT attempt to modify node taints, labels, or pod specs — that should be left to the user.
Diagnostic Flow
1. Read the pod and its events — one call
k8s_inspect(kind: "pod", name: "<pod>", namespace: "<ns>")The scheduler's FailedScheduling event carries the reason, and this returns the pod's events
alongside its phase and container states in a single call.
Two things to read carefully:
- The
FailedSchedulingmessage — it says how many nodes were evaluated and why each was rejected, and that count is what separates "no capacity anywhere" from "one taint on one node". The compact bundle keeps substantially more of long scheduler messages, but if a line ends in…, fetch that event withkubectl get eventsorkubectl describe podbefore concluding from the missing tail. - The final
status:line.partial (events: …)means the events could not be read at all — nothing below applies until that is fixed.
An empty events section is not a conclusion. Events expire on a TTL (commonly one hour), so zero events means none are retained, which covers two opposite situations:
- the scheduler never spoke — a missing scheduler, an admission webhook, or a
schedulerNamenothing is servicing. Reachable, and a different problem from every pattern below. - the scheduler spoke long ago and the record aged out. This is the likely one for a pod that has been Pending for hours, i.e. exactly when the events are empty.
Use the pod's own PodScheduled condition to tell them apart — it is part of the object, so it does
not expire. PodScheduled=False (Unschedulable: …) carries the scheduler's verdict and its message
survives the event that first reported it; if the pod has no PodScheduled condition at all, the
scheduler genuinely has not processed it. Read the pod's age against the cluster's event retention
before treating an empty section as evidence of anything.
If the message names a specific node, read that node the same way:
k8s_inspect(kind: "node", name: "<node>")Reach for kubectl describe pod <pod> -n <ns> when you need the pod's affinity rules, tolerations or
volume declarations verbatim.
2. Match scheduling failure and investigate
Match the FailedScheduling message against the patterns below.
Insufficient cpu / Insufficient memory — Not enough resources
No node has enough allocatable CPU or memory to satisfy the pod's resource requests.
Check node resource usage:
kubectl top nodesCheck what the pod is requesting:
kubectl get pod <pod> -n <ns> -o jsonpath='{.spec.containers[*].resources.requests}'Advise the user to either reduce the pod's resource requests, scale up existing nodes, or add new nodes to the cluster.
didn't match Pod's node affinity/selector — Node affinity/selector mismatch
The pod has a nodeSelector or nodeAffinity that no available node satisfies.
Check the pod's node selection criteria:
kubectl get pod <pod> -n <ns> -o jsonpath='{.spec.nodeSelector}'
kubectl get pod <pod> -n <ns> -o jsonpath='{.spec.affinity}'Check available node labels:
kubectl get nodes --show-labelsAdvise the user to either update the pod's selector/affinity or add the required labels to appropriate nodes.
had taint ... that the pod didn't tolerate — Taint/toleration mismatch
Nodes have taints that the pod does not tolerate.
Check node taints:
kubectl get nodes -o custom-columns='NAME:.metadata.name,TAINTS:.spec.taints[*].key'Check the pod's tolerations:
kubectl get pod <pod> -n <ns> -o jsonpath='{.spec.tolerations}'Advise the user to either add the appropriate toleration to the pod or remove the taint from a node.
persistentvolumeclaim ... not found / not bound — PVC issue
The pod references a PVC that does not exist or is not bound to a PV.
Check PVC status:
kubectl get pvc -n <ns>If the PVC exists but is Pending, check its events:
kubectl describe pvc <pvc-name> -n <ns>Common causes: no matching PV, StorageClass not found, or provisioner failed.
0/N nodes are available (all filtered) — No nodes available
Every node in the cluster was rejected. The message usually lists multiple reasons. Address each reason individually — the most impactful one is typically resource insufficiency or taints.
didn't find available persistent volumes — No matching PV
The PVC exists but no PV matches its requirements (size, access mode, storage class).
kubectl get pv
kubectl get pvc <pvc-name> -n <ns> -o yamlpod has unbound immediate PersistentVolumeClaims — PVC not yet bound
The PVC is waiting for a PV to be provisioned. Check if the StorageClass provisioner is working:
kubectl get storageclass
kubectl get events -n <ns> --field-selector involvedObject.name=<pvc-name>Preempting — Scheduler is preempting lower-priority pods
The scheduler is attempting to evict lower-priority pods to make room. This is normal behavior for priority-based scheduling. If the pod remains Pending after preemption, there may be additional constraints.
Notes
- If no
FailedSchedulingevent exists, the pod may not have been processed by the scheduler yet — check if the scheduler pod itself is healthy:kubectl get pods -n kube-system -l component=kube-scheduler. - For pods created by controllers (Deployment, StatefulSet), the pending pod name may change as the controller recreates it — use label selectors to find the current pending pod.
- If the pod has a
scheduling.volcano.sh/pod-groupannotation, it is managed by Volcano scheduler — usevolcano-diagnose-podskill instead for Volcano-specific issues (PodGroup, Queue, Gang scheduling).
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

