Making namespaces and quotas work for multi-tenant Kubernetes clusters

Kubernetes namespaces are the simplest, most familiar tool for isolating teams and applications in a shared cluster — but alone they’re not enough to prevent resource sprawl, noisy neighbors, or accidental denial of service. ResourceQuota and LimitRange give you control inside a namespace. For organizations trying to balance self-service and cluster stability, a practical pattern combines namespaces, quotas and (where useful) hierarchical namespace tooling — with a clear understanding of what each primitive actually enforces and what it doesn’t.

This article walks through the design thinking and concrete examples for governing multi-tenant clusters with namespaces and resource quotas, and highlights a recent change in the ecosystem you should know about.

Quick vocabulary refresher

Common multi-tenant patterns and where quotas fit

  1. One-namespace-per-tenant (simple)
    • Pros: easy to reason about RBAC and quotas; native Kubernetes primitives.
    • Cons: tenants who need multiple isolated environments (dev/test/prod or many microservices) often request multiple namespaces, increasing management overhead.
  2. Namespace-per-application, grouped by labels (team-level governance)
    • Pros: flexible; teams own multiple namespaces and can run different apps with varying SLAs.
    • Cons: harder to enforce a team-level resource budget unless you implement a higher-level controller or aggregated accounting.
  3. Hierarchical namespaces (team namespace as parent of app namespaces)
    • Pros: allows policy propagation and the idea of a team-level quota that spans child namespaces.
    • Cons: introduces extra control-plane components and operational complexity — and note that the HNC project has been archived as of April 17, 2025, which affects long-term support and adoption choices. (github.com)

For most clusters, the sweet spot is a mix of pattern 1 or 2 plus careful use of ResourceQuota and LimitRange. Cloud providers and platform teams commonly recommend creating quotas for each namespace and matching them to realistic requests for Pods, CPU and memory. This reduces overcommit and gives a clear surface for chargeback or capacity planning. (cloud.google.com)

Why LimitRange and ResourceQuota should be used together

ResourceQuota only counts what resources are requested or created; if pods don’t declare requests, quota accounting can be misleading. LimitRange helps by:

Using LimitRange alongside ResourceQuota avoids the “silent oversubscription” case where teams deploy lots of pods with no resource requests and the cluster runs out of capacity. (kubernetes.io)

Practical examples

1) A basic LimitRange that sets defaults and maxima for containers:

apiVersion: v1
kind: LimitRange
metadata:
  name: team-limits
  namespace: team-alpha
spec:
  limits:
  - type: Container
    default:
      cpu: "250m"
      memory: "256Mi"
    defaultRequest:
      cpu: "100m"
      memory: "128Mi"
    max:
      cpu: "1"
      memory: "1Gi"

This ensures that any container created without explicit requests gets a sensible request and limit — making quota accounting predictable. (kubernetes.io)

2) A ResourceQuota that caps total CPU, memory and number of Pods in a namespace:

apiVersion: v1
kind: ResourceQuota
metadata:
  name: team-alpha-quota
  namespace: team-alpha
spec:
  hard:
    pods: "50"
    requests.cpu: "8"
    requests.memory: "16Gi"
    limits.cpu: "12"
    limits.memory: "24Gi"

This prevents a single namespace from consuming more than its share of cluster resources and sets a clear boundary for platform teams. (kubernetes.io)

Accounting for teams that need multiple namespaces

If a team needs several namespaces (for example: team-alpha-dev, team-alpha-staging, team-alpha-prod), there are two practical ways to express a team budget:

For enterprises, cloud provider guidance often highlights starting with per-namespace quotas and using labeling/tagging plus platform automation for higher-level aggregation and chargeback. (cloud.google.com)

Operational tips and real-world gotchas

When hierarchical namespaces make sense (and when they don’t)

Hierarchical namespaces help when:

They’re less useful when:

Also, because the HNC project’s repo was archived on April 17, 2025, evaluate vendor support and long-term maintenance before building critical platform capabilities on it. Archived projects can still be valuable, but they shift operational risk onto your team. (github.com)

A pragmatic checklist for quota-driven namespace governance

Closing thought

Namespaces, ResourceQuota and LimitRange are the practical building blocks to keep a shared cluster healthy — they’re simple individually but require coordinated policy and monitoring to be effective at scale. Hierarchical approaches add expressive power for complex organizations, but recent changes in the community landscape (for example, the archiving of the HNC repository on April 17, 2025) mean platform teams must weigh operational cost and support when choosing extensions. Clear quotas plus predictable defaults and good observability will keep tenants productive and minimize noisy-neighbor risk. (kubernetes.io)