BM: Baca dalam Bahasa Melayu
World K5: Lunch Rush
metrics-server and kubectl top
You will learn: how to see which tray uses the most CPU and memory right now.
Checked with Kubernetes 1.37 on 31 Oct 2026
The problem
Lunch is slow today. Every tray says Running. But one of them eats the stall’s memory. How do you find it?
Pick one answer.
Watch
kind-dev namespace defaultkubectl top needs a meter reader. That reader is metrics-server: The meter reader: it checks how much CPU and memory each tray uses right now. kubectl top and the HPA read it.. A fresh kind cluster has none.
error: Metrics API not available means: nobody reads the meters yet.
Try it
This cluster has metrics-server. Type kubectl top pods. Which tray uses the most memory?
kind-dev namespace defaultdev-control-planeOpenManagerNo trays here.
dev-workerOpen- report
- shop·nv7hj
dev-worker2Open- shop·bdxbf
- shop·spmrh
Hint
Typekubectl top pods, then press Enter.Check
kubectl top pods showed this. Who is hungry?
NAME CPU(cores) MEMORY(bytes)
report 1m 287Mi
shop-bc64465c6-bdxbf 1m 3Mi
shop-bc64465c6-nv7hj 1m 3MiPick one answer.
Try it
kubectl top nodes shows each stall. report sits on one worker stall. Tap that stall: it uses about 300Mi more than its twin.
Tap the worker stall where report runs.
0 of 1 found
Predict
kubectl top says 287Mi now. You ask again in an hour. What can it show you?
Pick one answer.
Check
metrics-server is built for autoscaling, not for monitoring. Sort each job.
Drag a card into a box. Or tap the card, then tap the box.
You did it!
You can now find the hungriest tray with kubectl top.
Go deeper (optional)
Real rep (optional), on a throwaway kind cluster only. The insecure flag is for testing, never a real cluster.
Real mission
kubectl apply -f https://github.com/kubernetes-sigs/metrics-server/releases/latest/download/components.yamlkubectl patch deployment metrics-server -n kube-system --type=json -p '[{"op":"add","path":"/spec/template/spec/containers/0/args/-","value":"--kubelet-insecure-tls"}]'kubectl top nodes
0 of 3 steps done · Your ticks are saved.
Bahasa Melayu
Waktu makan tengah hari lambat hari ini. Setiap pod (dulang) kata Running. Tapi satu daripadanya makan memori gerai. Macam mana nak cari?
kubectl top perlukan pembaca meter. Pembaca itu ialah metrics-server. Kluster kind yang baharu tiada pembaca ini.
error: Metrics API not available maksudnya: belum ada sesiapa baca meter.
Kluster ini ada metrics-server. Taip kubectl top pods. Pod mana guna memori paling banyak?
kubectl top pods, kemudian tekan Enter.kubectl top pods tunjuk ini. Siapa yang lapar?
NAME CPU(cores) MEMORY(bytes)
report 1m 287Mi
shop-bc64465c6-bdxbf 1m 3Mi
shop-bc64465c6-nv7hj 1m 3Mi
kubectl top nodes tunjuk setiap gerai. report duduk di satu gerai pekerja. Tekan gerai itu: ia guna kira-kira 300Mi lebih daripada kembarnya.
kubectl top kata 287Mi sekarang. Anda tanya lagi sejam kemudian. Apa yang ia boleh tunjuk?
metrics-server dibina untuk autoskala, bukan untuk pemantauan. Asingkan setiap kerja.
Kini anda boleh cari pod paling lapar dengan kubectl top.
You finished this before. Practice is always welcome!
Official docs: Kubernetes: resource metrics pipeline · kubectl top · metrics-server (kubernetes-sigs)
You've learned for 25 minutes. A short break helps your brain.
Sprint done! Great focus. Stretch for a minute?