BM: Baca dalam Bahasa Melayu
World K5: Lunch Rush
Logs and events
You will learn: how to read the cook's notebook (logs) and the manager's notice board (events).
Checked with Kubernetes 1.37 on 31 Oct 2026
The problem
A customer says order 42 came late. The kitchen tray says Running. Where do you look first?
Pick one answer.
Watch
kind-dev namespace defaultlogs: The cook's notebook: everything a container prints. are the cook’s notebook: everything the container prints. kubectl logs kitchen reads it. There’s the clue: the oven was too cold.
Try it
Busy cooks write long notebooks. Show only the last line with --tail=1.
kind-dev namespace defaultdev-control-planeOpenManagerNo trays here.
dev-workerOpen- kitchen
dev-worker2OpenNo trays here.
Hint
Typekubectl logs kitchen --tail=1.Watch
kind-dev namespace defaultCrashLoopBackOff: the tray keeps crashing, so Kubernetes waits longer between restarts. Each restart starts a clean notebook. --previous reads the notebook from the run that crashed.
Predict
You delete the kitchen pod. A new one takes its place. Can you still read the old pod’s logs?
Pick one answer.
Watch
kind-dev namespace defaultevent: A note on the manager's notice board: scheduled, pulled, started, or a warning. Kept for a short time. are the manager’s notice board: placed, pulled, started, and warnings. Kubernetes writes them, not your app. They fade after a short time.
Check
Notebook or notice board? Sort each line.
Drag a card into a box. Or tap the card, then tap the box.
You did it!
You can now read a tray’s logs and the zone’s events.
Go deeper (optional)
kubectl logs -f kitchen follows new lines. -c cook picks one container. --since=10m shows only recent lines. kubectl events --for pod/kitchen shows one pod’s events. By default the API server keeps events for one hour. To keep logs longer, send them to a log store (next lesson).
Bahasa Melayu
Seorang pelanggan kata pesanan 42 lambat sampai. Pod (dulang) dapur kata Running. Di mana anda lihat dulu?
Log ialah buku nota tukang masak: semua yang container cetak. kubectl logs kitchen membacanya. Itu petunjuknya: ketuhar terlalu sejuk.
Tukang masak yang sibuk tulis buku nota yang panjang. Tunjuk baris terakhir sahaja dengan --tail=1.
kubectl logs kitchen --tail=1.CrashLoopBackOff: pod asyik rosak, jadi Kubernetes tunggu lebih lama antara setiap restart. Setiap restart mula buku nota baharu. --previous baca buku nota larian yang rosak.
Anda padam pod kitchen. Pod baharu ambil tempatnya. Bolehkah anda masih baca log pod lama?
Event ialah papan notis pengurus: diletak, ditarik, dimulakan, dan amaran. Kubernetes yang tulis, bukan aplikasi anda. Ia hilang selepas masa yang singkat.
Buku nota atau papan notis? Asingkan setiap baris.
Kini anda boleh baca log pod dan event zon.
You finished this before. Practice is always welcome!
Official docs: Kubernetes: logging architecture · kubectl logs · kubectl events
You've learned for 25 minutes. A short break helps your brain.
Sprint done! Great focus. Stretch for a minute?