Pod Resource Management
The web-app Deployment in namespace resources-ns has 3 replicas but none of the pods are running. A ResourceQuota has been applied to the namespace that limits total CPU and memory.
Live lab access
This task description is public. Its live lab requires full access; six other CKA labs are available in Free Practice with AI Lab Coach.
Create an account to continue →
Explore the six free labs with AI Lab Coach →
Read the brief on any device. Use a desktop or laptop for the terminal lab. Nothing starts until you choose Start.
The task
The web-app Deployment in namespace resources-ns has 3 replicas but none of the pods are running.
A ResourceQuota has been applied to the namespace that limits total CPU and memory. The Deployment does not have resource requests or limits configured, so the pods are being blocked by the quota.
Task:
- Investigate why the pods are not being created
- Inspect the ResourceQuota to find the total CPU and memory budget
- Edit the Deployment so that each pod gets an equal share of the quota (requests must equal limits)
- Confirm all 3 pods are Running
Original Prepium workshop · Tested on Kubernetes v1.35.0 on 1 October 2026 in a kind cluster. Run this independent example in a disposable cluster. It uses its own quota and numbers, not the simulator's task.
When a ResourceQuota silently stops your Pods
A ResourceQuota caps the total resources a namespace may claim. Once a quota limits requests.cpu, limits.memory or similar, every new Pod in that namespace must declare those values, or the API server refuses to create it. The refusal does not appear on the Deployment you applied. It appears as an event on the ReplicaSet, which is why this failure looks silent.
1. Reproduce the symptom
Save this as quota-budget.yaml. It contains a quota and a Deployment whose container has no resources.
apiVersion: v1
kind: ResourceQuota
metadata:
name: team-budget
namespace: prepium-tutorial
spec:
hard:
requests.cpu: "1"
requests.memory: 1Gi
limits.cpu: "2"
limits.memory: 2Gi
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: api
namespace: prepium-tutorial
spec:
replicas: 2
selector:
matchLabels:
app: api
template:
metadata:
labels:
app: api
spec:
containers:
- name: web
image: nginx:1.27-alpine
kubectl create namespace prepium-tutorial
kubectl apply -f quota-budget.yaml
kubectl -n prepium-tutorial get deploy,rs,pods
The Deployment exists and shows 0/2 ready, the ReplicaSet wants 2 Pods, and there are no Pods at all. Not Pending, not crashing: never created. Follow the ownership chain down to where the error is recorded:
kubectl -n prepium-tutorial get events --field-selector reason=FailedCreate
kubectl -n prepium-tutorial describe rs
The message is precise: failed quota: team-budget: must specify limits.cpu for: web; limits.memory for: web; requests.cpu for: web; requests.memory for: web. It names the quota and the container, and lists every missing field.
2. Read the budget, then size the Pods
kubectl -n prepium-tutorial describe quota team-budget
The Hard column is the namespace total; Used is what admitted Pods already claim. Decide per-Pod values that fit the replica count you need, then set them on the Pod template:
kubectl -n prepium-tutorial set resources deployment api \
--requests=cpu=200m,memory=256Mi --limits=cpu=400m,memory=512Mi
kubectl -n prepium-tutorial rollout status deployment/api
kubectl -n prepium-tutorial describe quota team-budget
Both Pods start. The quota now shows requests.cpu 400m / 1 and requests.memory 512Mi / 1Gi: two Pods' worth of what you declared.
3. Hit the ceiling on purpose
kubectl -n prepium-tutorial scale deployment api --replicas=6
kubectl -n prepium-tutorial get deploy api
kubectl -n prepium-tutorial get events --field-selector reason=FailedCreate | tail -1
Only 4 of 6 replicas appear. CPU had room for 5 Pods, but memory ran out at 4 (4 × 256Mi requests = 1Gi, and 4 × 512Mi limits = 2Gi). The event says exactly which dimension is exhausted: exceeded quota: team-budget, requested: limits.memory=512Mi,requests.memory=256Mi, used: limits.memory=2Gi,requests.memory=1Gi. The quota is enforced on whichever resource runs out first, so check every row, not just CPU.
4. Give containers defaults with a LimitRange
A namespace admin can avoid the "must specify" failure for everyone by adding defaults. Save this as limitrange-defaults.yaml:
apiVersion: v1
kind: LimitRange
metadata:
name: container-defaults
namespace: prepium-tutorial
spec:
limits:
- type: Container
defaultRequest:
cpu: 100m
memory: 128Mi
default:
cpu: 200m
memory: 256Mi
kubectl -n prepium-tutorial scale deployment api --replicas=1
kubectl apply -f limitrange-defaults.yaml
kubectl -n prepium-tutorial run bare --image=nginx:1.27-alpine
kubectl -n prepium-tutorial get pod bare -o jsonpath='{.spec.containers[0].resources}{"\n"}'
The Pod was created without any resources in its manifest, yet it shows requests: cpu 100m, memory 128Mi and limits: cpu 200m, memory 256Mi. The LimitRange admission step filled them in before the quota was checked. Defaults apply only to Pods created after the LimitRange; existing Pods are unchanged.
| Example check | Evidence |
|---|---|
| Root cause identified | FailedCreate event naming the quota |
| Every container declares what the quota requires | Requests and limits present in the Pod template |
| Desired replicas fit the budget | READY equals desired; quota Used stays within Hard |
Cleanup: kubectl delete namespace prepium-tutorial (the quota and LimitRange are namespaced and go with it). Reference: Resource Quotas and Limit Ranges. Next, try autoscaling on CPU requests.
Video walkthrough: Split Node Resources on YouTube. It shows the full solution, so try the task first.
What this tests
Run and schedule workloads - deployments, autoscaling, taints and tolerations, affinity, and resource limits. On the CKA exam, Workloads & Scheduling tasks are graded purely on what you build in the cluster - not multiple choice - so the only way to get faster is to do them on a real cluster against a clock.
Practice it for real
The public description lets you study the task before signing up. Full access includes every live lab. Six selected CKA scenarios are included in Free Practice, with five shared sessions each week. You solve the task in a real terminal, hit validate, and a programmatic checker scores exactly what you got right and wrong (with partial credit). You can open the solution while practising, then retry and use the failed checks to improve your score.