K8s by Example: Resource Quotas
| Resource Quotas limit aggregate resource consumption per namespace. They prevent any single team from consuming all cluster resources. Quotas apply to CPU, memory, storage, and object counts. Use for: multi-tenant clusters, cost control, capacity planning, preventing runaway workloads. |
| compute-quota.yaml | |
| Compute quotas limit total CPU and memory in a namespace. Both | |
| object-count-quota.yaml | |
| Object count quotas limit the number of resources. Prevent namespace sprawl with too many Pods, Services, or ConfigMaps. Useful for limiting PersistentVolumeClaims to control storage costs. | |
| storage-quota.yaml | |
| Storage quotas limit total storage and number of claims. Can be scoped by StorageClass to allow more SSD storage than HDD, or limit expensive storage tiers. | |
| scoped-quota.yaml | |
| Scoped quotas apply only to certain Pods. Use scopes to create different limits for BestEffort vs Guaranteed QoS, or for terminating vs long-running Pods. | |
| limit-range.yaml | |
| LimitRange sets defaults and constraints per Pod/Container. Unlike ResourceQuota (namespace aggregate), LimitRange applies to individual resources. Use together: LimitRange for per-pod constraints, ResourceQuota for namespace totals. | |
| priority-quota.yaml | |
| Priority-based quotas limit resources by PriorityClass. Allow more resources for critical workloads, fewer for batch jobs. Scope quotas to specific priority levels. | |
| terminal | |
| Monitor quota usage to track consumption and plan capacity. The Used column shows current consumption; Hard shows the limit. Alerts when approaching limits help prevent workload rejections. | |