BM: Baca dalam Bahasa Melayu
World K6: Guards
Capstone mission 5: Guard it
You will learn: to give Kedai Kancil badges, locks, fences and seals, then prove the cluster refuses a root or unsigned image.
Checked with Kubernetes 1.37 on 31 Oct 2026
The problem
kind-dev namespace defaultMission 5: Guard it. Your goal: your own cluster refuses a root or unsigned image, like this. Four jobs: badges, locks, fences, seals.
Try it
Step 1: badges and locks. kubectl can write the YAML for you with --dry-run=client -o yaml.
Real mission
kubectl create serviceaccount ci-bot -n kedai --dry-run=client -o yaml > k8s/base/rbac.yamlecho "---" >> k8s/base/rbac.yaml && kubectl create role deployer -n kedai --verb=get,list,patch --resource=deployments --dry-run=client -o yaml >> k8s/base/rbac.yamlecho "---" >> k8s/base/rbac.yaml && kubectl create rolebinding ci-bot-deployer -n kedai --role=deployer --serviceaccount=kedai:ci-bot --dry-run=client -o yaml >> k8s/base/rbac.yamlkubectl label --dry-run=server --overwrite ns kedai pod-security.kubernetes.io/enforce=restrictedkubectl auth can-i get secrets -n kedai --as=system:serviceaccount:kedai:ci-bot
0 of 8 steps done · Your ticks are saved.
Watch
Your kedai zone will carry two guard labels. One checks locks. One checks seals.
Tap the label that refuses a root tray.
0 of 1 found
Try it
Step 2: fences and seals. The seal commands come from GitHub’s guide, written for Helm 4.
Real mission
kubectl run probe --rm -it --restart=Never --image=busybox:1.37 -- wget -qO- -T 2 http://api.kedaihelm upgrade policy-controller --install --rollback-on-failure --create-namespace --namespace artifact-attestations oci://ghcr.io/sigstore/helm-charts/policy-controller --version 0.10.5helm upgrade trust-policies --install --rollback-on-failure --namespace artifact-attestations oci://ghcr.io/github/artifact-attestations-helm-charts/trust-policies --version v0.7.0 --set policy.enabled=true --set policy.organization=YOUR-NAMEkubectl label namespace kedai policy.sigstore.dev/include=true
0 of 8 steps done · Your ticks are saved.
Check
Let GitHub’s public API confirm your files. Type your username, then check.
Check it on GitHub
- Your Kedai Kancil repo is publicNot checked yet
- It has k8s/base/rbac.yamlNot checked yet
- It has k8s/base/networkpolicy.yamlNot checked yet
Check
The API can’t see inside your cluster. Check these yourself.
Real mission
kubectl auth can-i patch deployments -n kedai --as=system:serviceaccount:kedai:ci-botkubectl run root-test -n kedai --image=nginx:1.29-alpine --dry-run=server
0 of 4 steps done · Your ticks are saved.
You did it!
You can now guard Kedai Kancil with badges, locks, fences and seals.
Go deeper (optional)
Safety: use your kind cluster only, never a work cluster. Read the pink “you are here” bar before each label or delete. Stuck pods? Run kubectl get events -n kedai. Kyverno or Gatekeeper can check seals too, if your team already uses one.
Bahasa Melayu
Misi 5: Kawal. Matlamat anda: kluster anda sendiri tolak image root atau tanpa tandatangan, macam ini. Empat kerja: lencana, kunci, pagar, meterai.
Langkah 1: lencana dan kunci. kubectl boleh tuliskan YAML untuk anda dengan --dry-run=client -o yaml.
Zon kedai anda akan bawa dua label pengawal. Satu semak kunci. Satu semak meterai.
Langkah 2: pagar dan meterai. Arahan meterai datang dari panduan GitHub, ditulis untuk Helm 4.
Biar API awam GitHub sahkan fail anda. Taip nama pengguna anda, kemudian semak.
API tak nampak dalam kluster anda. Semak sendiri perkara ini.
Kini anda boleh kawal Kedai Kancil dengan lencana, kunci, pagar dan meterai.
You finished this before. Practice is always welcome!
Official docs: Pod Security Standards · Using RBAC authorization · Network Policies · GitHub: enforce artifact attestations in Kubernetes · Helm 4: helm upgrade
You've learned for 25 minutes. A short break helps your brain.
Sprint done! Great focus. Stretch for a minute?