# Pod "my-pod" evicted due to resource quota: the pod has been evicted because its resource usage exceeds the quota for the namespace

- **ID:** `policy/kubernetes-pod-eviction-resource-quota`
- **Domain:** policy
- **Category:** resource_error
- **Verification:** ai_generated
- **Fix Rate:** 85%

## Root Cause

Kubernetes ResourceQuota enforces limits on total CPU/memory per namespace; a pod exceeding its request/limit triggers eviction when cumulative usage hits the quota.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| Kubernetes v1.28 | active | — | — |
| Kubernetes v1.29 | active | — | — |
| kubelet v1.28.3 | active | — | — |

## Workarounds

1. **Check current namespace quota usage: kubectl describe quota -n <namespace>. Then reduce pod resource requests/limits to fit within available quota, e.g., in deployment YAML set resources.requests.cpu: "250m" and resources.requests.memory: "256Mi".** (85% success)
   ```
   Check current namespace quota usage: kubectl describe quota -n <namespace>. Then reduce pod resource requests/limits to fit within available quota, e.g., in deployment YAML set resources.requests.cpu: "250m" and resources.requests.memory: "256Mi".
   ```
2. **Increase the namespace ResourceQuota by editing it: kubectl edit quota <quota-name> -n <namespace> and raising spec.hard.cpu or spec.hard.memory.** (80% success)
   ```
   Increase the namespace ResourceQuota by editing it: kubectl edit quota <quota-name> -n <namespace> and raising spec.hard.cpu or spec.hard.memory.
   ```
3. **Use cluster autoscaling or node scaling to add more resources, then adjust quota accordingly.** (70% success)
   ```
   Use cluster autoscaling or node scaling to add more resources, then adjust quota accordingly.
   ```

## Dead Ends

- **** — Simply restarting the pod without adjusting resource limits causes immediate re-eviction. (90% fail)
- **** — Increasing the pod's resource requests without checking namespace quota may still fail if the quota is already maxed out. (70% fail)
- **** — Deleting the ResourceQuota object to bypass limits can lead to resource starvation for other pods. (80% fail)
