How to fix exceeded quota in Kubernetes

KubernetesBEGINNERMEDIUMUpdated Dec 7, 2025· 237 views

This error occurs when creating resources that would exceed namespace ResourceQuota limits. Fix it by reducing resource requests, deleting unused resources, or requesting a quota increase from your cluster administrator.

Quick fix

Fixes exceeded quota

# View detailed quota and usage
kubectl describe resourcequota -n <namespace>

# Get specific quota in YAML format
kubectl get resourcequota <quota-name> -n <namespace> -o yaml
  1. Diagnose current quota usage
  2. Find resource-heavy pods
  3. Reduce resource requests in pod specs
  4. Delete unused pods and PVCs
kubernetes — error
# View detailed quota and usage
kubectl describe resourcequota -n <namespace>
# Get specific quota in YAML format
kubectl get resourcequota <quota-name> -n <namespace> -o yaml
exceeded quota

What this error means

The "exceeded quota" error indicates that creating the requested resource would cause the namespace to exceed its ResourceQuota limits. ResourceQuotas in Kubernetes constrain the total amount of resources (CPU, memory, storage, object counts) that can be consumed within a namespace. When you try to create a Pod, PVC, or other resource, the quota controller calculates whether the new resource's requirements plus existing usage would exceed the quota's hard limits. If so, the API server rejects the request with HTTP 403 Forbidden. This is a namespace-level constraint—existing pods continue running, but new resource creation is blocked until usage drops below the quota or the quota is increased.

Typical symptoms

  • Pod creation fails with "pods is forbidden: exceeded quota" error
  • HTTP 403 Forbidden response from API server
  • Deployments stuck with 0 replicas despite cluster having available resources
  • New PersistentVolumeClaims rejected
  • Error specifies which quota (CPU, memory, pods, storage) was exceeded

Common causes

  1. Pod requests more CPU/memory than namespace quota allows
  2. Cumulative usage from multiple workloads reached quota ceiling
  3. Pods without explicit requests/limits rejected when quota requires them
  4. Storage quota exhausted by existing PersistentVolumeClaims
  5. Object count quota reached (pods, configmaps, secrets, services)

How to fix "exceeded quota"

1Diagnose current quota usage

View quota and current usage:

bash
# View detailed quota and usage
kubectl describe resourcequota -n <namespace>

# Get specific quota in YAML format
kubectl get resourcequota <quota-name> -n <namespace> -o yaml

Output shows:
- spec.hard: The quota limits
- status.used: Current consumption
- status.hard: Enforced limits

Compare used vs hard to identify which resource is exceeded.

2Find resource-heavy pods

Identify which pods consume the most resources:

bash
# Sort pods by CPU usage
kubectl top pods -n <namespace> --sort-by=cpu

# Sort pods by memory usage
kubectl top pods -n <namespace> --sort-by=memory

# View resource requests for all pods
kubectl get pods -n <namespace> -o custom-columns=\
'NAME:.metadata.name,CPU_REQ:.spec.containers[*].resources.requests.cpu,MEM_REQ:.spec.containers[*].resources.requests.memory'

Identify candidates for deletion or resource reduction.

3Reduce resource requests in pod specs

Lower the resource requests to fit within quota:

yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: my-app
spec:
  template:
    spec:
      containers:
      - name: app
        image: my-image
        resources:
          requests:
            cpu: "100m"        # Reduced from 500m
            memory: "128Mi"    # Reduced from 512Mi
          limits:
            cpu: "200m"
            memory: "256Mi"

Apply and verify:

bash
kubectl apply -f deployment.yaml
kubectl get pods -n <namespace>
4Delete unused pods and PVCs

Free up quota by removing unused resources:

bash
# Delete unused pods
kubectl delete pod <pod-name> -n <namespace>

# Delete pods by label
kubectl delete pods -l app=unused -n <namespace>

# Delete unused PersistentVolumeClaims
kubectl delete pvc <pvc-name> -n <namespace>

# Force delete stuck pods
kubectl delete pod <pod-name> -n <namespace> --grace-period=0 --force

Wait 15-30 seconds for quota controller to sync freed resources.

5Request quota increase from admin

If legitimate workload growth requires more resources:

yaml
apiVersion: v1
kind: ResourceQuota
metadata:
  name: compute-quota
  namespace: <namespace>
spec:
  hard:
    requests.cpu: "8"          # Increased from 4
    requests.memory: "16Gi"    # Increased from 8Gi
    limits.cpu: "12"
    limits.memory: "24Gi"
    pods: "20"                 # Increased from 10

Admin applies the updated quota:

bash
kubectl apply -f quota.yaml
kubectl describe resourcequota -n <namespace>
6Set up LimitRange for defaults

Prevent future issues by setting default resource values:

yaml
apiVersion: v1
kind: LimitRange
metadata:
  name: default-limits
  namespace: <namespace>
spec:
  limits:
  - type: Container
    default:
      cpu: "200m"
      memory: "256Mi"
    defaultRequest:
      cpu: "100m"
      memory: "128Mi"
    max:
      cpu: "1000m"
      memory: "1Gi"
    min:
      cpu: "50m"
      memory: "64Mi"

Apply:

bash
kubectl apply -f limitrange.yaml

New pods without explicit resources will receive these defaults.

Advanced notes

Quota Scopes: ResourceQuotas can be scoped to specific Pod priority classes:

yaml
scopeSelector:
  matchExpressions:
  - scopeName: PriorityClass
    operator: In
    values: ["high-priority"]

Available Scopes:
- BestEffort: Pods with no resource limits
- NotBestEffort: Pods with at least one resource limit
- Terminating / NotTerminating: Based on activeDeadlineSeconds
- PriorityClass: Based on pod priority

Best Practices:
1. Always pair ResourceQuota + LimitRange together
2. Use PriorityClass scopes for tiered quotas
3. Monitor quota usage regularly
4. Set quotas conservatively to prevent cluster overcommit
5. Document quota limits for development teams

Frequently asked questions

What does "exceeded quota" mean?
The "exceeded quota" error indicates that creating the requested resource would cause the namespace to exceed its ResourceQuota limits. ResourceQuotas in Kubernetes constrain the total amount of resources (CPU, memory, storage, object counts) that can be consumed within a namespace. When you try to create a Pod, PVC, or other resource, the quota controller calculates whether the new resource's requirements plus existing usage would exceed the quota's hard limits.
How do I fix "exceeded quota"?
This error occurs when creating resources that would exceed namespace ResourceQuota limits. Fix it by reducing resource requests, deleting unused resources, or requesting a quota increase from your cluster administrator.
What causes "exceeded quota"?
Pod requests more CPU/memory than namespace quota allows Cumulative usage from multiple workloads reached quota ceiling Pods without explicit requests/limits rejected when quota requires them
Is the "exceeded quota" error serious?
It is a medium-severity error — more of a blocker than a risk. The steps above resolve it.

Official resources & further reading