{"canonical_url":"https://engineer.company/glossary/resource-quota/","content_markdown":"# Resource quota\n\n## What it is\n\nA resource quota limits how much of a shared platform a group of workloads can\nrequest or create. In Kubernetes, a ResourceQuota applies to a namespace. It can\nlimit values such as total requested CPU, memory or storage, or the count of\nobjects of a particular type. When a request to create or update a resource\nwould exceed an applicable quota, the API can refuse that request.\n\nA quota can account for resource requests and limits declared by applications.\nThe sum of requested memory in a namespace is a different measurement from the\namount processes currently use. A workload may reserve capacity in its\nconfiguration and use less while traffic is quiet. The quota's accounting\nreflects the configured entries it covers. Live resource measurements help\ndecide whether the configured amounts make sense, while the quota establishes\nwhich new declarations the platform will accept.\n\nOther controls act at different boundaries. A container can have an individual\nresource limit. A LimitRange can supply defaults or apply bounds to values for\nindividual objects in a namespace. The scheduler uses resource requests and\nother constraints to find a node for a Pod. A quota check can pass while the\nscheduler still has no suitable place to run the new Pod. An operator needs\nenough visibility to distinguish these outcomes.\n\n## Why it matters\n\nA shared cluster often serves several workloads with independent release\nschedules. A team can add more replicas to a test deployment while another team\nneeds capacity for an important job. A quota defines how much each group may\nallocate through the API and gives the teams a reason to review requests when\ntheir workloads change. It can also limit objects with operational or financial\neffects, such as persistent storage claims.\n\nBudgets become most useful when they reflect peak operating procedures. A\nservice with three replicas may need one more during a rolling update. Another\nservice can need space for an occasional data repair. The average steady load\ngives only part of the picture. Make room for approved temporary capacity and\ntest the path to acquire it. A quota that blocks every legitimate transition can\nslow essential work without improving any team's understanding of its capacity.\n\nThere is also a cost to unused declared capacity. A namespace with large\nrequested amounts can consume its budget even when the workloads run lightly.\nReview allocation and actual load together. Lowering requests without measuring\ncan shift the problem to runtime, where slow work or resource pressure is\nvisible to users. Set the values from representative operation, with explicit\nroom for the changes the team plans to make.\n\n## What it looks like in practice\n\nImagine a namespace whose workload has a total CPU request budget of four cores.\nThree replicas each request one core. One more can fit the namespace's\nconfigured budget if the scheduler has room and the other constraints pass. A\nfifth equally sized replica would exceed it. A useful test observes the\ncontroller's desired count, the Pod creation result and the number that actually\nbecome ready. Those readings tell the team where capacity stopped increasing.\n\nNow test a rollout that starts a new Pod before it removes an existing one. The\npeak amount requested during overlap can be higher than the steady allocation.\nInspect the final states and the denied or pending requests. Document the normal\nheadroom and the conditions for temporary changes. A team can also test a\nrollback that needs to recreate a previous resource and check that the same\nbudget leaves room for it.\n\nEngineer's\n[cloud capacity and cost case study](/portfolio/a-tenth-of-the-cloud-bill-and-nothing-lost/)\ndescribes reviewing use, adjusting capacity and removing unnecessary services. A\nnamespace quota gives a shared platform an explicit operating limit to examine\nduring that kind of review. The illustrative example ties it to a reproducible\nworkload. Over time, compare admitted resources, actual consumption and service\noutcomes before changing a group's allocation.\n\n## Where it goes wrong\n\nA quota can become a number chosen without a connection to the workload.\nDifferent services need different amounts of memory at startup, may use storage\nin different ways, and do not all scale at the same time. Use visible accounting\nto find which claims contribute to the budget. A test should include at least\none request that exceeds the quota and show how the service reports that outcome\nto its owner.\n\nInspect the requested resource at the point where the controller actually\ncreates it. A controller may have accepted a wider desired state while the Pods\nit tries to add encounter quota. Record events on the controller and the\nresulting objects. A dashboard can show the difference between configured\nallocation, current usage and changes that the namespace has refused. Keep the\nexplanation tied to the application's desired capacity so a rollout owner can\nchoose a proportionate remedy.\n\nAdmission rules can also interact unexpectedly with defaults. A deployment can\nomit resource requests in its source while another policy supplies a value on\ncreation. The resulting total can be higher than expected. Inspect the effective\nobject and confirm which values the quota counts. This is particularly important\nwhen importing manifests from another environment with different defaults or\nmoving workloads to a shared namespace.\n\nFinally, keep the error paths clear. A rejected creation under quota, a pending\nPod without a suitable node and a running process that hits a resource limit can\nall result in fewer useful instances than expected. They require different\nevidence and responses. A regular capacity check should identify which boundary\napplies, record the measurement and show what change will help without\ninterfering with the work of other teams.\n\n## Further reading\n\n- [Kubernetes ResourceQuota](https://kubernetes.io/docs/concepts/policy/resource-quotas/).\n  Describes namespace accounting, scopes and resource types.\n- [Kubernetes LimitRanges](https://kubernetes.io/docs/concepts/policy/limit-range/).\n  Explains defaults and constraints for individual resources.\n- [Kubernetes resource management for containers](https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/).\n  Connects requests and limits to scheduling and execution.\n\n\u003chttps://engineer.company/glossary/resource-quota/\u003e\n","date_modified":"2026-11-25T07:18:46Z","description":"Apply a Kubernetes namespace quota and verify the difference between accepting a workload and finding capacity for it.","formats":{"gemtext":"https://engineer.company/glossary/resource-quota/index.gmi","gopher":"https://engineer.company/glossary/resource-quota/gophermap","html":"https://engineer.company/glossary/resource-quota/","json":"https://engineer.company/glossary/resource-quota/index.json","markdown":"https://engineer.company/glossary/resource-quota/index.md","pdf":"https://engineer.company/glossary/resource-quota/index.pdf"},"kind":"page","language":"en","title":"What is a resource quota?","url":"https://engineer.company/glossary/resource-quota/","version":1}