World map

 

BM: Baca dalam Bahasa Melayu

World K1: The Food Court

Drive it with kubectl

You will learn: the six kubectl commands you will use every day.

Checked with Kubernetes 1.37 on 31 Oct 2026

The problem

Your boss says the shop is acting weird. You have one tool: kubectl. What do you do first?

Pick one answer.

Watch

You are here: cluster kind-dev namespace default
kubectl apply -f tray.yaml creates pod/tray. kubectl get pods shows it Pending, 0/1: still getting ready. Terminal output: $ kubectl apply -f tray.yaml pod/tray created $ kubectl get pods NAME READY STATUS RESTARTS AGE tray 0/1 Pending 0 0s

kubectl: Your walkie-talkie to the office: the command-line tool that talks to the API server. is your walkie-talkie to the office. kubectl apply -f tray.yaml puts up the order in that file. kubectl get pods lists your trays. Pending means still getting ready.

Try it

A tray looks odd? Ask for its whole story. Type kubectl describe pod tray. Read the Events at the end.

You are here: cluster kind-dev namespace default
Stalls: 3. Trays: 2 (2 ready). Waiting for a stall: 0.
dev-control-planeOpenManager

No trays here.

dev-workerOpen
  • tray
dev-worker2Open
  • kitchen
Time: +0s (sped up)

Predict

The kitchen app printed a message. Which command shows it?

Pick one answer.

Watch

You are here: cluster kind-dev namespace default
kubectl logs kitchen prints: Kedai Kancil is open. kubectl exec kitchen -- hostname prints: kitchen. Terminal output: $ kubectl logs kitchen Kedai Kancil is open $ kubectl exec kitchen -- hostname kitchen

kubectl logs kitchen shows what the app printed. kubectl exec kitchen -- hostname runs one command inside the tray.

Try it

Build a command that asks the kitchen pod its name, from inside.

Tap the pieces in the right order.

…

Try it

Now tidy up. Read the pink bar first: kind-dev, default. Then delete the tray with kubectl delete pod tray.

You are here: cluster kind-dev namespace default
Stalls: 3. Trays: 2 (2 ready). Waiting for a stall: 0.
dev-control-planeOpenManager

No trays here.

dev-workerOpen
  • tray
dev-worker2Open
  • kitchen
Time: +0s (sped up)

Check

Which commands only look, and which change the cluster?

Drag a card into a box. Or tap the card, then tap the box.

      You did it!

      You can now look, change and clean up with kubectl.

      Go deeper (optional)

      kubectl get pods -w keeps watching. kubectl logs -f kitchen follows new lines. kubectl exec -it kitchen -- sh opens a shell inside. The practice terminal only explains that one.

      Real mission

      1. kubectl run tray --image=nginx:1.29-alpine
      2. kubectl get pods
      3. kubectl describe pod tray
      4. kubectl logs tray
      5. kubectl delete pod tray

      0 of 5 steps done · Your ticks are saved.