How ResourceQuota and LimitRange keep one team from exhausting a shared Kubernetes cluster
A platform team that shares one cluster across several teams or customers will eventually meet the noisy neighbor: one namespace launches a batch job, a runaway deployment or a fleet of replicas, and the scheduler has no capacity left for everyone else. ResourceQuota caps what a namespace may consume in total, covering CPU and memory requests and limits, storage requests and object counts such as pods, services and persistent volume claims. LimitRange sets per-object defaults and bounds, so a pod that omits requests or limits receives sensible values and no single container can ask for an unbounded amount. The two work together: a quota is enforced at admission, and pods that do not declare resources can be rejected once a quota tracks those fields.
A shared cluster needs both controls as soon as tenants can create workloads without a central review. RBAC decides who may create objects in a namespace, but it says nothing about how much those objects may consume, so a fully authorized developer can still starve a neighbor. Quotas, LimitRanges, network policies and Pod Security Admission address different risks, and they should be designed as one set per tenant boundary. Confirm with your cluster version and admission configuration how quota scopes handle priorityClassName, because quotas can be scoped to priority classes and that choice decides which workloads count against a limit. Ask whether the platform team or tenant owners will change quotas, and who approves an increase.
Before you roll quotas out, check the existing workloads in each namespace. Once a compute quota is in place, new pods without resource requests can fail to schedule, so set LimitRange defaults first and test a representative deployment in a staging namespace. Record the quota values and their owners in version control, and review actual usage against them on a schedule. The official Kubernetes documentation on resource quotas covers the field syntax; your implementation partner or team should confirm version-specific behavior against the release you run.
Which quota and LimitRange settings fit which situation
This table compares the main quota and LimitRange settings for a shared cluster, showing when each fits and what it can break. Read each row as a decision: find the situation you have, then check the risk column before you apply the setting to production namespaces.
| Setting | When it fits | What it can break |
|---|---|---|
| Compute quotas (requests and limits for CPU and memory) | Teams with predictable workloads that need a hard ceiling on what their namespace can reserve from the cluster | Rollouts and autoscaling stall when a namespace reaches its ceiling, and pods without declared requests are rejected once a compute quota exists |
| Storage quotas per StorageClass | Shared clusters where one class is expensive or limited, such as fast local disks, so teams cannot claim it without approval | PVC creation fails at the limit, which can block stateful upgrades or restores that need a temporary extra volume |
| Object count quotas | Protecting the API server and etcd from teams that create very large numbers of Services, ConfigMaps, Secrets or Jobs | CI systems and controllers that create many short-lived objects hit the count and fail in bursts, so confirm object churn before setting limits |
| LimitRange default requests and limits | Teams that deploy manifests without resource settings and still need a compute quota to work | Defaults can be too small for real workloads, causing throttling or out-of-memory kills that look like application bugs |
| LimitRange min and max bounds | Preventing single containers from requesting a whole node or far too little to schedule reliably | Bounds that are too tight reject valid workloads at admission, and the error appears only when a team deploys |
| Quota scope by PriorityClass | Giving critical system or production workloads a separate budget from batch jobs in the same namespace | Pods that do not match the scope are not counted by it, so a missing or misspelled PriorityClass can bypass the intended limit |
| Quota scope by QoS or terminating state | Separating long-running services from CronJobs or build pods that set activeDeadlineSeconds | Scope rules are easy to misread, and a pod that falls outside the scope can consume resources the team expected to be capped |
Using LimitRange defaults and priority class scopes together
A ResourceQuota only counts what it can measure. When a namespace has a quota for CPU or memory, every pod in that namespace must declare requests and limits for those resources, or the API server rejects it. A LimitRange closes that gap. Its default and defaultRequest fields fill in missing limits and requests at admission, so ordinary workloads that omit resource stanzas are accepted and still count against the quota. Set the LimitRange values from observed usage in the namespace, not from guesses, and confirm them with the team that owns each workload before the quota goes live. Remember that these defaults are applied only when pods are created or updated. Existing pods keep the values they were admitted with, so changing a LimitRange does not resize running workloads.
Quota scopes add a second budget. A ResourceQuota can carry a scopeSelector that matches a PriorityClass by name, using the scopeName value PriorityClass. A quota scoped this way counts only pods that use the listed priority classes, so a team can hold a separate, smaller allowance for high-priority work and keep its general quota intact. Pods in the scope must still satisfy the namespace's other quotas and any LimitRange defaults, so the two controls need to be designed together. Confirm which priority classes your platform team has defined and who may assign them, because a user who can set priorityClassName on a pod can move work into a scope they should not use.
Admission controls interact in ways that surprise teams. Pod Security Admission enforces the Pod Security Standards per namespace, and it does not change resource settings, so a pod can pass the Restricted profile and still be rejected by a quota. Evaluate both in a test namespace before you apply them to production. Also check that your quota, LimitRange and priority class manifests are version controlled with the namespace definitions, since a missing default is only discovered when a deployment fails. Ask your platform team to confirm the admission order and error messages in the Kubernetes version you run, using the Kubernetes documentation on resource quotas as the reference for field names.
How to roll out quotas to an existing shared cluster
This sequence moves a shared cluster from no limits to enforced quotas without breaking running workloads. Each step ends with a check, so the platform team knows what is in place before the next change.
Inventory current usage per namespace
The platform team lists every namespace and records its current CPU and memory requests and limits, persistent volume claims, and counts of pods, services and other objects. Use
kubectl get namespacestogether withkubectl top podsand the metrics your monitoring stack already collects, so peaks are captured as well as averages. Note which namespaces have no owner. The step is done when every namespace has a usage record and an owning team, and any unowned namespace is flagged for an owner decision before quotas apply.Agree quota values with each team in writing
The platform team proposes a quota for each namespace based on the inventory, with headroom agreed with the owning team. Record the values, the date they take effect, and who approves changes in a document both sides sign off. Ask each team to confirm whether any workload needs burst capacity, storage growth, or a higher pod count. The step is done when every owner has approved a written set of values, and the platform team holds those values in version control alongside the manifests they will generate.
Apply LimitRange defaults before quotas
Create a LimitRange in each namespace that sets default requests and limits for containers and, where needed, minimum and maximum bounds. Apply it before any ResourceQuota, because once a quota that covers CPU or memory exists, pods without explicit requests or limits are rejected. Confirm defaults are sensible for the workloads in the inventory. The check is
kubectl describe limitrangein each namespace, and the step is done when defaults show the expected values and a test pod with no resource section is admitted with them.Apply ResourceQuota to each namespace
Apply the agreed ResourceQuota objects, covering compute, storage and object counts, and use quota scopes where priority classes need separate budgets. Apply namespaces in batches, starting with those with the most headroom, so any surprises are contained. The check is that
kubectl describe resourcequotashows the hard limits and current usage for each namespace. The step is done when every quota reports the agreed hard values and the usage column matches the inventory, with no workload already above its limit.Verify enforcement with a rejected deployment
Test the quota with a deployment that exceeds the namespace limit, such as an illustrative replica count that requests more memory than remains. The expected result is an admission error from the API server that names the exceeded resource. Then deploy a workload within the quota to confirm it schedules. Repeat for a storage claim and an object count. Run these tests in a non-production namespace first. The step is done when the rejected deployment fails with a quota error, the compliant one succeeds, and the results are recorded for the owning teams.
Handle namespaces already running workloads
For namespaces with running pods, check usage against the new hard limits before applying the quota. A quota does not evict existing pods, but if current usage exceeds the new hard limit, new pods and scaling will fail. Pods created before LimitRange defaults existed may also lack requests, which affects scheduling and quota accounting. Ask owners to set explicit requests on their deployments during a planned rollout, and schedule changes with them. The step is done when no namespace is over its limit and owners confirm their rollout windows.
Monitor usage and adjust quotas
Track quota usage against hard limits over time using the metrics your monitoring stack collects, and alert owners before a namespace approaches its limit. Review rejected requests in events and API server logs to find teams that are blocked. Adjust values through the same written approval process used at the start. Ask the platform team to confirm alert routing and the review cadence with each owner. The step is done when alerts reach the right owners and the first scheduled review has recorded any changed quota values.
Pod requests pass LimitRange and ResourceQuota before scheduling
The diagram follows a pod create request from the client to the API server. Authentication and RBAC decide whether the request is allowed at all. LimitRange then fills in default requests and limits and rejects values outside its minimum and maximum. ResourceQuota checks namespace totals using those defaulted values before the pod is stored in etcd and the scheduler places it. Any stage can reject the request, so check the quota and limit values against the namespace's actual usage.
Admission stages a pod passes before the scheduler sees it, with rejection points.
Security and operational risks of quota misconfiguration
Quotas and default limits protect a shared cluster, but they also create their own failure modes. The risks below cover who can change the policy, how workloads fail when requests are missing, what happens when a namespace fills up during an incident, and why usage needs watching.
Editing quota objects is privilege
A user who can edit a ResourceQuota or LimitRange in their namespace can raise their own limits, which defeats the control entirely. Kubernetes RBAC governs these objects like any other resource, so the verbs create, update, patch and delete on ResourceQuota and LimitRange should be limited to the platform team. Check every RoleBinding that grants wildcard or broad verbs in tenant namespaces, because a role that looks read-focused may still include write verbs.
Authentication docsMissing requests block scheduling
When a namespace has a CPU or memory quota, pods that do not declare the matching request or limit are rejected at admission. Deployments then stall with replica sets that never reach their desired count, which often looks like a broken controller rather than a policy gap. A LimitRange with default requests and limits lets teams deploy without setting values on every container, but the defaults must be sized for real workloads. Confirm the behavior in a staging namespace before rolling a quota to production.
Quota exhaustion during incidents
A namespace at its quota cannot create new pods, even when the work is recovery work such as a rollback, a replacement pod or a debugging container. Teams that run incident tooling in the same namespace as their application can find themselves unable to respond. Plan a reserved quota or a separate namespace for platform and incident workloads, and test a rollback while the tenant namespace is at its limit.
Quota usage needs monitoring
A quota only prevents overuse if someone sees it approaching the limit. ResourceQuota status shows used and hard values per resource, but those numbers are not alerted on by default. Export quota usage to your metrics stack, set alerts before namespaces reach their hard limits, and review the trend when a team asks for a larger quota. Ask your monitoring team which exporter and dashboards they will own.
Priority class scopes need review
Quota scopes can restrict a namespace to particular priority classes, so a team cannot launch its highest priority pods without an allowance for them. Mismatched scopes can either block critical workloads or let a tenant claim a priority class it should not have. Review which PriorityClasses exist, who can create them, and which namespaces are allowed to use each one.
Questions teams ask before setting quotas in a shared cluster
How much does it cost to set up ResourceQuota and LimitRange in a shared cluster?
The cost is the scoped work of designing quota and limit values for each team, applying them as manifests, and checking that workloads still schedule. DeployOpen does not publish prices, and a quote follows from a written scope. The main cost drivers are how many teams and namespaces share the cluster, how many workload types need different defaults, whether priority classes are in use, and whether quotas must be tied to a chargeback or GitOps process. Ask for a quote that lists the namespaces covered, the review workshop, the testing against representative workloads and any handover documentation, so you can compare it with the effort your own team would spend.
How long does a quota and LimitRange rollout take?
Duration depends on the number of teams, how well current resource usage is understood, and how many workloads lack requests and limits today. Most of the time goes into measuring real consumption, agreeing values with each team and testing that deployments, Jobs and autoscalers behave correctly once quotas are enforced. Teams that already run metrics and can show peak usage per namespace usually move faster. The timeline should be agreed in writing as part of the fixed scope before work starts, with checkpoints for each namespace group.
What do we need to provide before the work starts?
You need to supply a list of namespaces or tenants, the owners who can approve limits, current usage data for CPU, memory, storage and object counts, and the workload types that run in each namespace. Access to a non-production cluster is valuable for testing. You should also confirm which priority classes exist and which teams depend on them. Without usage history, the first quota values are guesses, so ask whether metrics retention covers a representative period.
Can our own platform team set quotas without a partner?
Yes, a capable platform team can write ResourceQuota and LimitRange objects and apply them with its normal delivery tooling. The effort is usually in the decisions rather than the YAML: choosing defaults that do not break existing pods, handling workloads without requests, and explaining to teams why a Deployment was rejected. A partner adds value when the team lacks time for measurement, testing and stakeholder agreement. Confirm internally who owns the quota values after the rollout, because quotas that nobody reviews drift over time.
How do quotas differ from namespace-per-team or vCluster isolation?
ResourceQuota limits how much a namespace can consume inside one shared API server and control plane, but it does not separate API objects, cluster-scoped resources or the control plane itself. Namespace-per-team with RBAC and network policies adds access separation, while a virtual cluster gives each tenant its own API server inside a host cluster. Quotas are usually the cheapest first control and are often combined with the other models. The tenancy decision is covered in the sibling topic on choosing a tenancy model, so check that choice before tuning quotas.
What is the difference between a ResourceQuota and a LimitRange?
A ResourceQuota caps the total of resources a namespace can request or hold, including CPU, memory, storage and object counts. A LimitRange sets per-container or per-pod defaults and bounds, so pods that omit requests and limits still receive sensible values. Quotas usually fail without LimitRange defaults, because pods that do not declare CPU or memory can be rejected when a compute quota is active. Engineers should check both objects together, for example with kubectl describe quota and kubectl describe limitrange in the target namespace.
What makes the effort go up or down?
Effort rises with the number of namespaces, the diversity of workloads, the presence of GPU or large batch jobs, missing resource declarations across existing manifests, and the need for priority-based quota scopes. It falls when workloads already declare requests, usage metrics are retained, and owners are available to approve values. Quota scopes for priority classes need extra testing because pods in different scopes are counted separately. Ask the provider how it will test eviction and scheduling behavior before enforcement, since that is where most surprises appear.
Do quotas stop a noisy neighbor on the nodes themselves?
Not fully. ResourceQuota limits what a namespace can ask the scheduler to reserve, but actual node pressure depends on usage, node sizing and eviction behavior. Pair quotas with requests and limits from LimitRange, node-level monitoring and, where needed, priority classes and disruption controls. Confirm with your team which failure modes matter most, such as memory exhaustion on shared nodes or storage filling up, because each needs a different control.
How DeployOpen works on this
DeployOpen plans and implements quota design for shared Kubernetes clusters inside infrastructure you control. The work starts with a written scope that maps each team's demand to namespace quotas, default requests and limits, and priority class rules before any manifests are applied.
How we scope
- Inventory existing namespaces, workloads, priority classes and current resource requests before proposing any quota values.
- Agree in writing which resources, quota scopes and tenants the engagement covers, along with the deliverables and timeline.
- Confirm with your platform team which quota objects and admission behavior your cluster version and distribution support.
How we build
- Write ResourceQuota and LimitRange manifests per namespace, with GitOps-ready files your team can review and version.
- Test quota behavior with rejected and accepted deployments, including pods that omit requests and pods using priority class scopes.
- Verify that quota exhaustion produces clear admission errors and that default limits do not throttle legitimate workloads.
How we hand over
- Document the quota model, the reasoning behind each value and the process for requesting an increase.
- Provide a runbook for diagnosing forbidden errors, checking namespace usage and adjusting limits safely during incidents.
- Walk your platform and application teams through the handover so they can apply the same pattern to new namespaces.
How we support
- Review quota usage as new teams, workloads and Kubernetes minor versions arrive, since quota behavior can change across upgrades.
- Ongoing support, upgrades and continuous testing are available as a retainer after the initial handover.
- Ask for the support scope, response expectations and review cadence in the quote, since these are set per engagement.

