BM: Baca dalam Bahasa Melayu
World K3: Counters & Doors
Debug with port-forward
You will learn: to open a private tunnel from your laptop to one pod.
Checked with Kubernetes 1.37 on 31 Oct 2026
The problem
The shop page looks odd. You want to see it in your own browser. But you don’t want to open a door to the whole street. What do you do?
Pick one answer.
Watch
kind-dev namespace defaultA port-forward: A private staff hatch from your laptop to one pod, while the command runs. is a private staff hatch. localhost:8080 on your laptop leads to port 80 of one shop tray.
Try it
Build the command: laptop port 8080 to the shop’s port 80.
Tap the pieces in the right order.
Try it
Now open the hatch, then visit it with curl.
kind-dev namespace defaultshop3/3 ready
dev-control-planeOpenManagerNo trays here.
dev-workerOpen- shop·4q525
- shop·q9bq4
dev-worker2Open- shop·gdtqw
Hint
On a real laptop, port-forward keeps running. Use a second terminal forcurl.Predict
You press Ctrl+C in the port-forward terminal. Then you open localhost:8080 again. What happens?
Pick one answer.
Check
Hatch or real door? Sort each job.
Drag a card into a box. Or tap the card, then tap the box.
You did it!
You can now open a private hatch to any pod for debugging.
Go deeper (optional)
svc/shop picks one tray when the hatch opens and sticks to it. If that tray goes away, the hatch breaks: run it again. --address 0.0.0.0 lets anyone on your Wi-Fi in. Use it only on purpose.
Real rep (optional), on a throwaway kind cluster with the shop Service:
Real mission
kubectl port-forward svc/shop 8080:80
0 of 3 steps done · Your ticks are saved.
Bahasa Melayu
Halaman kedai nampak pelik. Anda mahu lihat dalam pelayar sendiri. Tapi anda tak mahu buka pintu kepada seluruh jalan. Apa anda buat?
port-forward ialah tingkap staf peribadi. localhost:8080 di laptop anda bawa ke port 80 satu dulang kedai.
Bina arahannya: port laptop 8080 ke port 80 kedai.
Sekarang buka tingkap itu, kemudian lawatinya dengan curl.
curl.Anda tekan Ctrl+C dalam terminal port-forward. Kemudian anda buka localhost:8080 semula. Apa jadi?
Tingkap atau pintu sebenar? Susun setiap kerja.
Kini anda boleh buka tingkap peribadi ke mana-mana pod untuk nyahpepijat.
You finished this before. Practice is always welcome!
Official docs: Kubernetes: use port forwarding · kubectl port-forward
You've learned for 25 minutes. A short break helps your brain.
Sprint done! Great focus. Stretch for a minute?