0
0
Kubernetesdevops~3 mins

Why Resource quotas per namespace in Kubernetes? - Purpose & Use Cases

Choose your learning style9 modes available
The Big Idea

What if one team's app crashes the whole cluster because it used too many resources? Resource quotas stop that from happening.

The Scenario

Imagine you manage a shared playground where many kids want to play with limited toys. Without rules, some kids grab all the toys, leaving none for others.

The Problem

Manually tracking who uses what resources in a Kubernetes cluster is like watching every kid all the time. It's slow, tiring, and mistakes happen--some teams use too much, others get none.

The Solution

Resource quotas per namespace set clear limits on how much each team can use. This way, everyone gets a fair share automatically, and the system keeps things balanced without constant watching.

Before vs After
Before
No limits set; teams deploy freely and can consume all resources.
After
apiVersion: v1
kind: ResourceQuota
metadata:
  name: team-quota
  namespace: team-namespace
spec:
  hard:
    pods: '10'
    requests.cpu: '4'
    requests.memory: 8Gi
    limits.cpu: '8'
    limits.memory: 16Gi
What It Enables

It enables fair, automatic sharing of cluster resources so no team can accidentally block others.

Real Life Example

A company runs multiple projects in one Kubernetes cluster. Using resource quotas per namespace, each project gets a fixed amount of CPU and memory, preventing one project from crashing the whole system.

Key Takeaways

Manual resource tracking is slow and error-prone.

Resource quotas set clear, automatic limits per namespace.

This keeps cluster resources fairly shared and stable.