quota-debug
Skill235 starsChanged 6 months agoApache-2.0View on GitHub
Diagnose Kubernetes native ResourceQuota and LimitRange admission rejections (exceeded quota, forbidden by LimitRange, FailedCreate). Checks namespace quotas, current usage, LimitRange constraints, and ReplicaSet events to identify why pods cannot be created. Not applicable to Volcano Queue — use volcano-queue-diagnose for gang scheduling clusters.
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
- pod-pending-debugSkill
- pvc-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
23 rules. About 0 are common, 10 are distinctive, and 13 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈10
Distinctive · estimate
This author's own choices. Worth a look.
13
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 11
When pods fail to be created due to Kubernetes native namespace-level resource constraints — ResourceQuota exceeded or LimitRange …
- Very specific: line 17
Not applicable to Volcano Queue: If the cluster uses Volcano for gang scheduling, resource quotas are managed by Volcano Queue, not …
- Very specific: line 23
If this command returns results (Queue resources listed), the cluster uses Volcano — use volcano-queue-diagnose.
- Distinctive: line 29
If the user reports a Deployment not progressing or pods not appearing, first find the controller that owns the pods:
- Very specific: line 41
Look for events with reason FailedCreate.
- Distinctive: line 43
If the user already has a specific error message, skip to step 2.
- Distinctive: line 53
Check current quota usage:
- Distinctive: line 80
If no pods exist yet (all creation failed), check the Deployment or template spec:
- Very specific: line 87
If Used is near Hard for cpu/memory: existing pods are consuming most of the quota — need to scale down other workloads or increase quota
- Very specific: line 88
If pods count is at the limit: too many pods in namespace — clean up or increase quota
- Distinctive: line 89
If the pod's resource requests are very large: consider reducing requests to fit within remaining quota
- Very specific: line 105
Check the Min column for Container type.
- Very specific: line 115
Check LimitRange as above and compare the Max column with the container's resource requests/limits.
- Very specific: line 127
Check the Max Limit/Request Ratio column.
- Very specific: line 139
Check if the LimitRange has Default and DefaultRequest values:
- Very specific: line 145
If Default and DefaultRequest are empty but Min or Max are set, containers MUST explicitly specify resources.
- Distinctive: line 157
If the sum of all container resources exceeds the Pod-level max, admission is rejected.
- Very specific: line 163
If the error mentions requests.storage or persistentvolumeclaims:
- Distinctive: line 169
Check the storage-related rows.
- Very specific: line 175
Look for keys like <storageclass>.storageclass.storage.k8s.io/requests.storage.
- Distinctive: line 185
All ResourceQuotas must be satisfied (intersection).
- Very specific: line 195
Look for spec.scopes or spec.scopeSelector.
- Distinctive: line 200
When a namespace has a ResourceQuota for compute resources (cpu/memory), every container must specify requests/limits for those resources, …
≈ “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
ResourceQuota & LimitRange Admission Diagnosis
When pods fail to be created due to Kubernetes native namespace-level resource constraints — ResourceQuota exceeded or LimitRange violations — follow this flow to identify the root cause.
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 ResourceQuota, LimitRange, or pod specs — that should be left to the user or cluster administrator.
When to use: Pods are not being created at all (not Pending, not CrashLoopBackOff — simply missing). Typical trigger: a ReplicaSet or Job shows FailedCreate events mentioning exceeded quota or forbidden: ... LimitRange.
Not applicable to Volcano Queue: If the cluster uses Volcano for gang scheduling, resource quotas are managed by Volcano Queue, not Kubernetes native ResourceQuota. Use the volcano-queue-diagnose skill instead. To check:
kubectl get queue 2>/dev/nullIf this command returns results (Queue resources listed), the cluster uses Volcano — use volcano-queue-diagnose. If it returns nothing or an error, Volcano is not installed — continue with this skill.
Diagnostic Flow
1. Identify the creation failure
If the user reports a Deployment not progressing or pods not appearing, first find the controller that owns the pods:
kubectl get rs -n <ns> --sort-by='.metadata.creationTimestamp' | grep <deployment-name>Then check the ReplicaSet events for creation failures:
kubectl describe rs <new-rs> -n <ns>Look for events with reason FailedCreate. The event message reveals whether it is a ResourceQuota or LimitRange rejection.
If the user already has a specific error message, skip to step 2.
2. Match the rejection type
exceeded quota — ResourceQuota exhausted
The namespace has a ResourceQuota and creating the pod would exceed the allowed limits.
Check current quota usage:
kubectl get resourcequota -n <ns>For detailed usage breakdown:
kubectl describe resourcequota -n <ns>Compare the Used vs Hard columns. Common quota dimensions:
- requests.cpu / requests.memory — total CPU/memory requests across all pods in the namespace
- limits.cpu / limits.memory — total CPU/memory limits
- pods — maximum number of pods allowed in the namespace
- count/deployments.apps, count/services — object count limits
- requests.nvidia.com/gpu — total GPU requests (common in GPU-scheduled clusters)
- requests.storage — total PVC storage requested
- persistentvolumeclaims — number of PVCs
Then check what the pod is requesting:
kubectl get pod -n <ns> -l app=<name> -o jsonpath='{range .items[0].spec.containers[*]}{.name}{"\t"}{.resources}{"\n"}{end}' 2>/dev/nullIf no pods exist yet (all creation failed), check the Deployment or template spec:
kubectl get deployment <name> -n <ns> -o jsonpath='{range .spec.template.spec.containers[*]}{.name}{"\t"}{.resources}{"\n"}{end}'Root cause analysis:
- If
Usedis nearHardfor cpu/memory: existing pods are consuming most of the quota — need to scale down other workloads or increase quota - If
podscount is at the limit: too many pods in namespace — clean up or increase quota - If the pod's resource requests are very large: consider reducing requests to fit within remaining quota
forbidden: ... minimum cpu/memory — LimitRange minimum violation
The pod's container does not meet the minimum resource request required by the namespace's LimitRange.
kubectl get limitrange -n <ns>kubectl describe limitrange -n <ns>Check the Min column for Container type. If a container does not specify resource requests, or its requests are below the minimum, admission will be rejected.
Compare with the pod's resource spec. If the container has no resource requests at all, the LimitRange default will be applied — but if the LimitRange has min without default, admission fails.
forbidden: ... maximum cpu/memory — LimitRange maximum violation
The pod's container exceeds the maximum resource limit allowed by the LimitRange.
Check LimitRange as above and compare the Max column with the container's resource requests/limits.
forbidden: ... maxLimitRequestRatio — LimitRange ratio violation
The ratio between the container's resource limit and request exceeds the allowed ratio (e.g., limit is 10x the request, but ratio cap is 3x).
kubectl describe limitrange -n <ns>Check the Max Limit/Request Ratio column. Then compare the pod's limits vs requests:
kubectl get deployment <name> -n <ns> -o jsonpath='{range .spec.template.spec.containers[*]}{.name}{"\t requests:"}{.resources.requests}{"\t limits:"}{.resources.limits}{"\n"}{end}'forbidden: ... no resources specified — Missing required resources
The LimitRange requires resource specifications, but the container has none and no defaults are configured.
Check if the LimitRange has Default and DefaultRequest values:
kubectl describe limitrange -n <ns>If Default and DefaultRequest are empty but Min or Max are set, containers MUST explicitly specify resources.
Pod type LimitRange — min/max per pod
LimitRange can also enforce constraints at the Pod level (sum of all containers). Check if the LimitRange has a Pod type entry:
kubectl get limitrange -n <ns> -o jsonpath='{range .items[*].spec.limits[*]}{.type}{"\t min:"}{.min}{"\t max:"}{.max}{"\n"}{end}'If the sum of all container resources exceeds the Pod-level max, admission is rejected.
exceeded quota for storage — PVC quota exhausted
If the error mentions requests.storage or persistentvolumeclaims:
kubectl describe resourcequota -n <ns>Check the storage-related rows. Also check if there are per-StorageClass quotas:
kubectl get resourcequota -n <ns> -o yamlLook for keys like <storageclass>.storageclass.storage.k8s.io/requests.storage.
3. Check for multiple constraints
A namespace can have multiple ResourceQuotas and LimitRanges. Always check for all of them:
kubectl get resourcequota,limitrange -n <ns>All ResourceQuotas must be satisfied (intersection). The most restrictive LimitRange applies.
4. Verify scoped quotas
ResourceQuotas can be scoped to specific priority classes or pod phases:
kubectl get resourcequota -n <ns> -o yamlLook for spec.scopes or spec.scopeSelector. A scoped quota only applies to pods matching the scope (e.g., PriorityClass=high). If the user's pod has a specific priority class, it may hit a scoped quota while the general quota still has capacity.
Notes
- ResourceQuota admission happens before scheduling. A pod rejected by quota will never appear in
kubectl get pods— look at the controller (ReplicaSet, Job) events instead. - When a namespace has a ResourceQuota for compute resources (cpu/memory), every container must specify requests/limits for those resources, otherwise admission is rejected. This catches users who are used to running without resource specs.
- LimitRange can automatically inject default requests/limits into containers that don't specify them. Check if defaults are configured before telling users to add explicit resource specs.
- For cross-reference: if the pod IS created but stuck in Pending, use the
pod-pending-debugskill instead — that covers scheduling failures (node resources, taints, affinity). kubectl top pods -n <ns>shows actual resource usage, while quota tracks requested resources. A namespace can hit quota limits even if actual usage is low. Note:kubectl toprequires metrics-server to be installed — if it returns an error, skip it and rely on quotaUsedvalues instead.
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.

