BM: Baca dalam Bahasa Melayu
World K4: Notes, Lockers & Packages
Lockers: PV and PVC
You will learn: to ask for storage with a PVC, so data outlives the pod that wrote it.
Checked with Kubernetes 1.37 on 31 Oct 2026
The problem
kind-dev namespace defaultThe cashier kept today’s orders inside its box. The pod was replaced. Every order is gone. You need a locker that stays.
Watch
Tap the line that says how big the locker is.
0 of 1 found
You fill in a locker request slip. That slip is a PersistentVolumeClaim (PVC): A locker request slip, like "I need 1Gi". Kubernetes finds or makes a PV for it. (PVC). It says how big, and how many may use it.
Predict
You apply the claim. kubectl get pvc says Pending. Why?
Pick one answer.
Try it
Apply the claim, then the cashier pod that uses it. Check the claim again.
kind-dev namespace defaultdev-control-planeOpenManagerNo trays here.
dev-workerOpenNo trays here.
dev-worker2OpenNo trays here.
Hint
cat cashier.yaml shows where the pod names the claim.Watch
kind-dev namespace defaultThe slip is now Bound to a PersistentVolume (PV): The real locker in the store room: storage that outlives pods. (PV): the real locker. Nobody built it by hand. The next lesson shows who did.
Try it
The cashier wrote an order into the locker. Replace the pod. Then read the orders.
kind-dev namespace defaultdev-control-planeOpenManagerNo trays here.
dev-workerOpen- cashier
dev-worker2OpenNo trays here.
Check
PV or PVC? Sort each one.
Drag a card into a box. Or tap the card, then tap the box.
You did it!
You can now keep data in a locker that outlives its pod.
Go deeper (optional)
Careful: kind’s standard class has reclaimPolicy: Delete. Delete the claim, and the PV and its data go too. Use Retain for data you must keep. While a pod uses the claim, deleting it waits. The claim shows Terminating until that pod is gone.
Real rep (optional), on a practice kind cluster:
Real mission
kubectl apply -f claim.yamlkubectl apply -f cashier.yamlkubectl get pvc,pvkubectl exec cashier -- sh -c 'echo teh tarik >> /data/orders.txt'kubectl delete -f cashier.yaml -f claim.yaml
0 of 6 steps done · Your ticks are saved.
Bahasa Melayu
Juruwang simpan pesanan hari ini di dalam bekasnya. Pod itu diganti. Semua pesanan hilang. Anda perlukan loker yang kekal.
Anda isi slip minta loker. Slip itu ialah PersistentVolumeClaim (PVC). Ia sebut saiz, dan berapa ramai boleh guna.
Anda apply claim itu. kubectl get pvc kata Pending. Kenapa?
Apply claim, kemudian pod juruwang yang guna claim itu. Semak claim sekali lagi.
cat cashier.yaml tunjuk di mana pod sebut nama claim.Slip itu kini Bound kepada PersistentVolume (PV): loker sebenar. Tiada siapa bina dengan tangan. Pelajaran seterusnya tunjuk siapa yang bina.
Juruwang sudah tulis pesanan dalam loker. Ganti pod itu. Kemudian baca pesanan.
PV atau PVC? Asingkan setiap satu.
Kini anda boleh simpan data dalam loker yang kekal walaupun pod hilang.
You finished this before. Practice is always welcome!
Official docs: Kubernetes: Persistent Volumes · Configure a Pod to use a PersistentVolume
You've learned for 25 minutes. A short break helps your brain.
Sprint done! Great focus. Stretch for a minute?