BM: Baca dalam Bahasa Melayu
World K3: Counters & Doors
Cluster DNS
You will learn: to call a Service by name, even in another namespace.
Checked with Kubernetes 1.37 on 31 Oct 2026
The problem
kind-dev namespace defaultThe menu moved to the kitchen zone. Now the client gets bad address 'menu'. Plain words: that name means nothing in this zone.
Watch
Every Service gets a name in the cluster DNS: The food court's directory: turns a Service name like menu.kitchen into its address., the food court’s directory. Put the parts of the full name in order.
Left to right, top first. Put these in order. Use the arrows, or drag.
- cluster.local (this cluster)
- kitchen (its namespace)
- svc (it is a Service)
- menu (the Service)
Watch
kind-dev namespace defaultWhy does plain shop work in your own zone? The pod’s search list adds default.svc.cluster.local for you. Other zones need their name.
Try it
Reach the menu from the client. Add its zone to the name.
kind-dev namespace defaultmenu1/1 ready
dev-control-planeOpenManagerNo trays here.
dev-workerOpen- menu·7w5wn
dev-worker2Open- client
Hint
http://menu.kitchen is the Service menu in the namespace kitchen.Predict
A pod inside the kitchen zone calls http://menu. Does it work?
Pick one answer.
Check
The client lives in the zone default. Judge each address it uses.
Swipe right for good, left for needs work. Or use the buttons.
http://shopYou did it!
You can now call any Service by name, in any namespace.
Go deeper (optional)
The directory is CoreDNS: pods in kube-system behind the Service kube-dns at 10.96.0.10. A headless Service’s name returns each pod’s own IP. If names fail everywhere, check CoreDNS first.
Real rep (optional), on a throwaway kind cluster:
Real mission
kubectl get pods -n kube-system -l k8s-app=kube-dnskubectl exec client -- cat /etc/resolv.confkubectl exec client -- wget -qO- -T 5 http://shop.default.svc.cluster.local
0 of 3 steps done · Your ticks are saved.
Bahasa Melayu
Menu dah pindah ke zon dapur. Sekarang client dapat bad address 'menu'. Maksudnya: nama itu tiada makna dalam zon ini.
Setiap Service dapat nama dalam DNS kluster, iaitu direktori medan selera. Susun bahagian nama penuhnya.
Kenapa shop sahaja berfungsi dalam zon anda? Senarai carian pod tambah default.svc.cluster.local untuk anda. Zon lain perlukan namanya.
Sampai ke menu dari client. Tambah zonnya pada nama.
http://menu.kitchen ialah Service menu dalam namespace kitchen.Pod di dalam zon dapur panggil http://menu. Adakah ia berfungsi?
Client tinggal dalam zon default. Nilai setiap alamat yang ia guna.
Kini anda boleh panggil mana-mana Service ikut nama, dalam mana-mana namespace.
You finished this before. Practice is always welcome!
Official docs: Kubernetes: DNS for Services and Pods · Kubernetes: debug DNS
You've learned for 25 minutes. A short break helps your brain.
Sprint done! Great focus. Stretch for a minute?