BM: Baca dalam Bahasa Melayu
World K3: Counters & Doors
NodePort, LoadBalancer and headless
You will learn: the four kinds of Service, and when to use each.
Checked with Kubernetes 1.37 on 31 Oct 2026
The problem
kind-dev namespace defaultThe shop’s order number is a ClusterIP. It only works inside the food court. Customers on the street can’t use it. How do they get in?
Watch
Tap each point on the timeline.
A Service has a type. Each type opens one more door than the last. Tap all four.
Try it
A NodePort: A side window on every stall: the same port (30000–32767) open on every node. opens the same port on every stall. Apply nodeport.yaml. Then call one stall’s address from your laptop.
kind-dev namespace defaultshop3/3 ready
dev-control-planeOpenManagerNo trays here.
dev-workerOpen- shop·dxxm9
- shop·v9wlp
dev-worker2Open- shop·sb74g
Hint
Stall addresses are inkubectl get nodes -o wide. Try curl http://172.18.0.3:30080.Watch
kind-dev namespace defaultA LoadBalancer: A street sign from the cloud: one outside address for a Service. asks the cloud for a street address. A plain kind cluster has no cloud, so it waits: <pending>.
Check
One letter is off. Read kubectl’s answer, then fix the file.
Fix the manifest, then press Apply.
Plain words: Kubernetes knows four types, and Loadbalancer is not one of them.
Predict
A database runs as a StatefulSet. Each tray must be called by its own name. Which Service fits?
Pick one answer.
Check
Which type fits each job?
Drag a card into a box. Or tap the card, then tap the box.
You did it!
You can now pick ClusterIP, NodePort, LoadBalancer or headless.
Go deeper (optional)
On kind, LoadBalancer addresses come from the extra tool cloud-provider-kind. NodePort calls from your laptop work on Linux. On Mac and Windows, kind’s nodes hide inside Docker’s small VM. There is a fifth type, ExternalName: an alias for an outside DNS name.
Real rep (optional), on a throwaway kind cluster:
Real mission
kubectl expose deployment shop --type=NodePort --port=80 --name=shop-npkubectl get service shop-npkubectl expose deployment shop --type=LoadBalancer --port=80 --name=shop-lb
0 of 3 steps done · Your ticks are saved.
Bahasa Melayu
Nombor pesanan kedai ialah ClusterIP. Ia hanya berfungsi di dalam medan selera. Pelanggan di jalan tak boleh guna. Macam mana mereka nak masuk?
Service ada jenis. Setiap jenis buka satu pintu lagi berbanding yang sebelumnya. Ketik keempat-empatnya.
NodePort buka port yang sama di setiap gerai. Apply nodeport.yaml. Kemudian panggil alamat satu gerai dari laptop anda.
kubectl get nodes -o wide. Cuba curl http://172.18.0.3:30080.LoadBalancer minta alamat jalan daripada cloud. Kluster kind biasa tiada cloud, jadi ia menunggu: <pending>.
Satu huruf tersilap. Baca jawapan kubectl, kemudian baiki fail itu.
Maksudnya: Kubernetes kenal empat jenis, dan Loadbalancer bukan salah satunya.
Pangkalan data berjalan sebagai StatefulSet. Setiap dulang mesti dipanggil ikut namanya sendiri. Service mana yang sesuai?
Jenis mana sesuai untuk setiap kerja?
Kini anda boleh pilih ClusterIP, NodePort, LoadBalancer atau headless.
You finished this before. Practice is always welcome!
Official docs: Kubernetes: Service types · Kubernetes: headless Services · kind: LoadBalancer
You've learned for 25 minutes. A short break helps your brain.
Sprint done! Great focus. Stretch for a minute?