BM: Baca dalam Bahasa Melayu
World K1: The Food Court
Dry run and kubectl explain
You will learn: to rehearse a command safely, and to look up any YAML field.
Checked with Kubernetes 1.37 on 31 Oct 2026
The problem
You need a Deployment file. Twenty lines of YAML, from memory? What is the smart move?
Pick one answer.
Watch
kind-dev namespace defaultA dry run: A rehearsal: kubectl shows what it would do, and changes nothing. is a rehearsal. --dry-run=client -o yaml prints the order and creates nothing. get deployments proves it: no resources found.
Try it
Your turn. Add the flags that print this pod’s YAML without making it.
kind-dev namespace defaultdev-control-planeOpenManagerNo trays here.
dev-workerOpenNo trays here.
dev-worker2OpenNo trays here.
Hint
Add--dry-run=client -o yaml at the end.Predict
--dry-run=client stays on your laptop. --dry-run=server asks the cluster to check, then throws it away. Which one catches more mistakes?
Pick one answer.
Watch
kind-dev namespace defaultForgot what a field means? kubectl explain reads the cluster’s own docs. Join the field path with dots: deployment, then spec, then replicas.
Try it
Build the command that explains a Pod’s restartPolicy.
Tap the pieces in the right order.
Check
Dry run or explain? Which one helps here?
Drag a card into a box. Or tap the card, then tap the box.
You did it!
You can now rehearse with a dry run and look up any field.
Go deeper (optional)
Where the story breaks: a real manager can improvise. Kubernetes can’t. It only chases what the order board says. And a closed stall’s trays never walk away. New trays are cooked elsewhere, with new names.
Real rep (optional): try these two on your kind cluster.
kind-dev namespace defaultBahasa Melayu
Anda perlukan fail Deployment. Dua puluh baris YAML, dari ingatan? Apa langkah yang bijak?
Dry run (raptai) ialah latihan. --dry-run=client -o yaml cetak pesanan tanpa cipta apa-apa. get deployments buktikannya: tiada apa-apa.
Giliran anda. Tambah flag yang cetak YAML pod ini tanpa membuatnya.
--dry-run=client -o yaml di hujung.--dry-run=client kekal dalam laptop anda. --dry-run=server minta kluster menyemak, kemudian membuangnya. Yang mana tangkap lebih banyak kesilapan?
Lupa maksud satu medan? kubectl explain baca dokumen kluster sendiri. Sambung laluan medan dengan titik: deployment, kemudian spec, kemudian replicas.
Bina arahan yang terangkan restartPolicy sebuah Pod.
Dry run atau explain? Yang mana membantu di sini?
Kini anda boleh buat raptai dengan dry run dan cari maksud mana-mana medan.
You finished this before. Practice is always welcome!
Official docs: kubectl create · kubectl explain · kubectl apply
You've learned for 25 minutes. A short break helps your brain.
Sprint done! Great focus. Stretch for a minute?