Skip to content

exceeded quota: deployment only half up – the ResourceQuota is full

Kubernetestested on Kubernetes v1.36.6

A ResourceQuota limits what a namespace may use in total – pods, CPU, memory. Once it is full, the API server rejects new pods. The deployment itself is still created, it just doesn't get all of its pods.

Symptom

k create deployment many --image=nginx:1.29 --replicas=6
k get deployment many
deployment.apps/many created
NAME   READY   UP-TO-DATE   AVAILABLE   AGE
many   3/6     3            3           8s

No error on creation, no pods in Pending: the missing pods never get created at all.

Diagnosis

You find the reason on the ReplicaSet, not on the deployment – and the usage in the quota.

k describe rs -l app=many | grep -m1 'exceeded quota'
  Warning  FailedCreate  8s  replicaset-controller  Error creating:
pods "many-6df65cc865-lgb8s" is forbidden: exceeded quota: tag05-quota,
requested: pods=1, used: pods=4, limited: pods=4
k describe quota tag05-quota | tail -6
Resource         Used   Hard
--------         ----   ----
limits.memory    256Mi  2Gi
pods             1      4
requests.cpu     100m   1
requests.memory  128Mi  1Gi

Causes

pods=4The pod count is reached

In the course the quota allows four pods, one is already running. Of six replicas only three fit. The message names requested, used and limited.

requests.cpuPods without requests

If requests.cpu is in the quota, every pod must have requests. In the course a LimitRange fills in defaults – without it the quota would reject the pod.

k get pod small -o jsonpath='{.spec.containers[0].resources}{"\n"}'
{"limits":{"memory":"256Mi"},"requests":{"cpu":"100m","memory":"128Mi"}}

Fix

Choose replicas that fit into the quota, or raise the quota. Pods without requests get defaults from a LimitRange.
▶
Break it yourself and find it – free
CKA hands-on, day 5: requests, LimitRange and ResourceQuota, affinity, taints, topology spread and static pods.
Go to day 5 →

FAQ

Why doesn't k describe deployment show the error?

The ReplicaSet creates the pods. The rejection is therefore in its events (FailedCreate).

Related error patterns

More