BM: Baca dalam Bahasa Melayu
World K2: Trays & Orders
Requests and limits
You will learn: how requests book room on a node, and how limits cap what a container uses.
Checked with Kubernetes 1.37 on 31 Oct 2026
The problem
One greedy tray eats all of a stall’s memory. The trays beside it starve and crash. How do you stop that?
Pick one answer.
Watch
A request (resources): The shelf space a container books. The scheduler only places a pod where it fits. is the shelf space a tray books. The scheduler puts a tray only where its request fits. Fit these trays on the stalls.
Tap a tray, then tap a stall. Or drag the tray.
Waiting trays
- stall-a
- stall-b
- Pending
Trays that fit on no stall wait here.
Watch
Requests and a limit (resources): The most a container may use. Over the CPU limit: slowed. Over the memory limit: killed. sit in each container.
resources:
requests:
cpu: 100m
limits:
memory: 128MiWhich does the scheduler use to pick a stall?
Pick one answer.
Try it
big asks for 64 CPUs. Real error: Insufficient cpu. Plain words: no stall is that big, so it waits in Pending forever. Ask for a tenth of a CPU.
kind-dev namespace defaultdev-control-planeOpenManagerNo trays here.
dev-workerOpenNo trays here.
dev-worker2OpenNo trays here.
- big·k9g8fPending
Hint
kubectl set resources deployment big --requests=cpu=100m changes the request.Predict
A tray reaches its CPU limit. What happens to it?
Pick one answer.
Try it
A request bigger than its limit makes no sense. Kubernetes refuses it. Fix one number.
Fix the manifest, then press Apply.
Check
True or not? Sort each sentence.
Drag a card into a box. Or tap the card, then tap the box.
You did it!
You can now book room with requests and cap use with limits.
Go deeper (optional)
CPU is counted in cores: 1000m is 1 CPU. Memory uses Mi and Gi (1Gi is 1024Mi). kubectl top pods (World K5) shows live use, so you can pick fair numbers.
Real rep (optional): on a throwaway cluster, ask for 64 CPUs. Then read the Events.
Bahasa Melayu
Satu dulang yang tamak makan semua memori gerai. Dulang di sebelahnya kelaparan dan crash. Bagaimana nak halang?
Request (tempahan) ialah ruang rak yang dulang tempah. Scheduler letak dulang hanya di tempat request itu muat. Muatkan dulang ini di gerai.
Requests dan limit (had) duduk dalam setiap container.
resources:
requests:
cpu: 100m
limits:
memory: 128MiYang mana scheduler guna untuk pilih gerai?
big minta 64 CPU. Ralat sebenar: Insufficient cpu. Maksudnya: tiada gerai sebesar itu, jadi ia tunggu dalam Pending selamanya. Minta satu persepuluh CPU.
kubectl set resources deployment big --requests=cpu=100m tukar request.Satu dulang capai had CPUnya. Apa jadi padanya?
Request yang lebih besar daripada limit tak masuk akal. Kubernetes tolak. Baiki satu nombor.
Betul atau tidak? Susun setiap ayat.
Kini anda boleh tempah ruang dengan requests dan hadkan penggunaan dengan limits.
You finished this before. Practice is always welcome!
Official docs: Kubernetes: Resource management for pods and containers · kubectl set resources
You've learned for 25 minutes. A short break helps your brain.
Sprint done! Great focus. Stretch for a minute?