BM: Baca dalam Bahasa Melayu
World K4: Notes, Lockers & Packages
Secrets: base64 is not a lock
You will learn: to hand a password to a pod with a Secret, and what really keeps it safe.
Checked with Kubernetes 1.37 on 31 Oct 2026
The problem
kind-dev namespace defaultYou put the till password in a Secret: The locked spice box for passwords and tokens. Its base64 hides nothing, so limit who can read it.. Its YAML says c3VwM3ItcmFoc2lh. It looks scrambled. But is it safe?
Watch
One command turns it back. That was base64: any bytes written as plain letters. It is a sticker that looks like a lock.
Predict
Who can read the till password right now?
Pick one answer.
Try it
Make the Secret and open the till. Then check its password.
kind-dev namespace defaultdev-control-planeOpenManagerNo trays here.
dev-workerOpenNo trays here.
dev-worker2OpenNo trays here.
Hint
till.yaml asks for the key PASSWORD from the Secret till.Try it
A teammate wrote this Secret by hand. Apply fails. Fix it.
Fix the manifest, then press Apply.
Watch
Drag a card into a box. Or tap the card, then tap the box.
Real locks exist. With encryption at rest, the API server locks Secrets before saving them. RBAC decides who may read them.
Check
Good habit or not? Swipe each one.
Swipe right for good, left for needs work. Or use the buttons.
Commit secret.yaml with the real password to Git.
You did it!
You can now hand a pod a password with a Secret, safely.
Go deeper (optional)
kubectl describe secret till shows sizes, never values. Mount a Secret as files, not env vars. Env vars can leak into crash reports. Managed clusters often encrypt Secrets with a cloud key (KMS). Next lesson: keeping Secrets out of Git.
Real rep (optional), on a practice cluster only. Use a fake password:
Real mission
kubectl config current-contextkubectl create secret generic till --from-literal=PASSWORD=practice-onlykubectl get secret till -o jsonpath={.data.PASSWORD}echo cHJhY3RpY2Utb25seQ== | base64 -dkubectl delete secret till
0 of 5 steps done · Your ticks are saved.
Bahasa Melayu
Anda simpan kata laluan mesin kira dalam Secret (kotak rempah berkunci). YAML-nya tulis c3VwM3ItcmFoc2lh. Nampak berselerak. Tapi selamatkah?
Satu arahan tukar ia balik. Itu base64: apa-apa data ditulis sebagai huruf biasa. Ia pelekat yang nampak macam kunci.
Siapa boleh baca kata laluan mesin kira sekarang?
Buat Secret dan buka mesin kira. Kemudian semak kata laluannya.
till.yaml minta kunci PASSWORD daripada Secret till.Rakan sepasukan tulis Secret ini sendiri. Apply gagal. Baiki ia.
Kunci sebenar memang ada. Dengan encryption at rest (penyulitan semasa disimpan), API server kunci Secret sebelum menyimpannya. RBAC tentukan siapa boleh membacanya.
Tabiat baik atau tidak? Leret setiap satu.
Kini anda boleh beri pod kata laluan dengan Secret, secara selamat.
You finished this before. Practice is always welcome!
Official docs: Kubernetes: Secrets · Good practices for Kubernetes Secrets · Encrypting confidential data at rest
You've learned for 25 minutes. A short break helps your brain.
Sprint done! Great focus. Stretch for a minute?