---
source: https://iinventedlight.com/library/notes/kubernetes-resource-quotas.md
title: "Kubernetes ResourceQuota caps total CPU, memory and object counts per namespace"
license: CC-BY-4.0
license_url: https://creativecommons.org/licenses/by/4.0/
source_license: "CC-BY-4.0 (Kubernetes docs); CC-BY-4.0 (kubernetes/website (GitHub)); prose restates cited source lines in own words"
license_family: mixed-green
attribution: "Summary by iinventedlight (AI-assisted). Sources: Kubernetes docs, Resource Quotas; kubernetes/website (GitHub), resource-quotas.md (source page). CC-BY-4.0 (https://raw.githubusercontent.com/kubernetes/website/main/LICENSE). Copyright The Kubernetes Authors."
author: "iinventedlight (synthesis of cited sources); text drafted with AI assistance"
date: 2026-11-18
status: published
approved_by: "Cole Withington, 2026-11-20 13:14 PT: \"Publish the full batch and rewrite the 6 live notes\""
checked_on: 2026-11-18
as_of: 2026-11-18
confidence: medium
untested: "Not reproduced (2026-11-18). Official docs and source files were read; no test suite, server, or API call was run for this note."
category: coding-references
topic_area: "code-devops: kubernetes resource quotas"
tags: [kubernetes, resourcequota, namespaces, multi-tenancy, limits]
client: Librarian
sources:
  - id: S1
    title: "Resource Quotas"
    publisher: Kubernetes docs
    url: https://kubernetes.io/docs/concepts/policy/resource-quotas/
    accessed: 2026-11-18
    license: "CC-BY-4.0"
  - id: S2
    title: "resource-quotas.md (source page)"
    publisher: kubernetes/website (GitHub)
    url: https://github.com/kubernetes/website/blob/main/content/en/docs/concepts/policy/resource-quotas.md
    accessed: 2026-11-18
    license: "CC-BY-4.0"
---
# Kubernetes ResourceQuota caps total CPU, memory and object counts per namespace
**Answer:** Create a ResourceQuota in each namespace with `spec.hard` limits such as `requests.cpu`, `limits.memory`, `pods` or `count/secrets`. A ResourceQuota provides constraints that limit aggregate resource consumption per namespace; requests that would exceed it are rejected with `403 Forbidden`.

## Example

```yaml
apiVersion: v1
kind: ResourceQuota
metadata:
  name: compute-resources
  namespace: myspace
spec:
  hard:
    requests.cpu: "1"
    requests.memory: 1Gi
    limits.cpu: "2"
    limits.memory: 2Gi
    pods: "4"
    count/secrets: "10"
```

```shell
kubectl describe quota compute-resources --namespace=myspace
```

## How it works

- A cluster administrator creates at least one ResourceQuota for each namespace, and teams work in different namespaces.
- The quota system tracks usage so it does not exceed the hard limits. A create or update that violates a quota is rejected with HTTP status code `403 Forbidden` and a message naming the constraint.
- Neither contention nor changes to quota will affect already created resources.
- If a quota covers `cpu` or `memory`, every new pod in that namespace must set requests or limits for it, or pod creation may be rejected. A LimitRange can force defaults so users don't have to remember.

## What can be limited

- `requests.cpu` and `requests.memory` cap the sum of requests across all pods in a non-terminal state; `cpu` and `memory` mean the same.
- `pods`, `services` and `services.loadbalancers` set the total number of those objects that can exist in the namespace.
- `count/<resource>` (core API group) or `count/<resource>.<group>` caps other kinds, such as `count/podtemplates`. These quotas protect against exhaustion of control plane storage, for example from too many large Secrets.

## See also

- [kubernetes-limit-ranges](https://iinventedlight.com/library/notes/kubernetes-limit-ranges/)
- [kubernetes-resource-requests-limits](https://iinventedlight.com/library/notes/kubernetes-resource-requests-limits/)
- [kubernetes-namespaces](https://iinventedlight.com/library/notes/kubernetes-namespaces/)

## Claims

- id: C1
  claim: Quota changes do not affect already created resources.
  source: S2
  evidence: "Neither contention nor changes to quota will affect already created resources."

- id: C2
  claim: Quota violations are rejected with 403 Forbidden.
  source: S2
  evidence: "the control plane rejects that request with HTTP status code `403 Forbidden`"

- id: C3
  claim: Object count quotas protect control plane storage.
  source: S1
  evidence: "These types of quotas are useful to protect against exhaustion of control plane storage."

## Sources

- [S1] Resource Quotas. Kubernetes docs. https://kubernetes.io/docs/concepts/policy/resource-quotas/ . License: CC-BY-4.0. Accessed 2026-11-18.

- [S2] resource-quotas.md (source page). kubernetes/website (GitHub). https://github.com/kubernetes/website/blob/main/content/en/docs/concepts/policy/resource-quotas.md . License: CC-BY-4.0. Accessed 2026-11-18.

License: this note is CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Summary by iinventedlight (AI-assisted). Sources: Kubernetes docs, Resource Quotas; kubernetes/website (GitHub), resource-quotas.md (source page). CC-BY-4.0 (https://raw.githubusercontent.com/kubernetes/website/main/LICENSE). Copyright The Kubernetes Authors. Text was condensed and changed from the originals.

---

Agents: [/agents.md](/agents.md) | [/.well-known/agent-library.json](/.well-known/agent-library.json).
