Split one cluster into team partitions When several teams share one cluster, resource names clash and it is easy to touch someone else's service. So you split it into named partitions, namespaces, such as team-a and team-b.
A namespace does not physically separate servers. It only divides names and permissions. Workload, network, and storage resources are each created inside a specific namespace.
Separate namespaces still share CPU and memory Even in different namespaces, CPU and memory come from the same cluster. If team-a scales up a lot of pods, team-b gets less.
Then team-b's new pods may find no node to run on and stay Pending. One team's mistake spills over into another team's service.
Watch out Namespaces only divide names and permissions. Resource usage is divided only once you set a quota.
A resource quota caps each namespace Set a resource quota on team-a. It lists caps on totals and counts, for example "CPU requests up to 4 cores, memory requests up to 8Gi, up to 20 pods".
A quota is a Kubernetes object called ResourceQuota. Write it in YAML and create it with kubectl apply, or create it directly with kubectl create quota.
What changed in this step
+ team-a quota: CPU 4 · memory 8Gi · 20 podsThe API server checks headroom for every new pod When a request to create a pod arrives, the API server first checks whether "current requests total + the new pod's requests" exceeds the cap.
If not, the pod is created and added to usage. team-a currently requests 3 CPU cores.
A pod over the cap is rejected at creation If a pod requesting 2 CPU cores arrives now, the total becomes 5 cores, over the 4-core cap. The API server rejects the pod and does not create it. Pods already running keep running.
If you deployed with a Deployment, you only see the pod count not going up. The reason appears as exceeded quota in the ReplicaSet events. Run kubectl describe quota to see the cap (Hard) and usage (Used) side by side.
Watch out Quotas are checked only at creation. If you lower a cap below current usage, existing resources are not cleaned up right away; only new ones are blocked.
Pods without requests are rejected too In a namespace whose quota covers CPU and memory, pods must set requests (a reservation: "I need at least this much") and limits. Pods without them are rejected.
A quota adds up totals and compares them to the cap, so it cannot count empty values. If you set defaults with a LimitRange (per-container defaults and min/max), pods that omit values get the defaults filled in, and this problem shrinks.
Watch out When deploying to a namespace with a quota, first check that you set requests. Also run kubectl get limitrange to see whether defaults exist.
Permissions are also split by namespace Kubernetes permissions (RBAC) have two scopes. ClusterRole and ClusterRoleBinding apply to the whole cluster. Role and RoleBinding apply within one namespace only.
A user granted permissions only through a RoleBinding in team-a can view and change only resources in team-a. The namespace becomes the permission boundary.
Key idea Give teams permissions only within their own namespace, and not permission to edit ResourceQuotas. Quotas mean something only when cluster admins set the namespaces and caps.
Namespaces divide names and permissions; quotas divide amounts A namespace draws the boundary for names and permissions, and a resource quota caps how much that namespace can use. The API server rejects pods that exceed the cap or lack requests at creation time.
RBAC uses the same namespaces as its unit of permission. So "which namespace" decides both what you can see and how much you can use.
Summary Namespaces divide names and permissions; resource quotas divide how much you can use. If pods do not scale up, check events for exceeded quota and Used and Hard in kubectl describe quota first.