BM: Baca dalam Bahasa Melayu
World K6: Guards
Policies: CEL, Kyverno, Gatekeeper
You will learn: to write a house rule for gate 3, roll it out safely, and pick a rule keeper.
Checked with Kubernetes 1.37 on 31 Oct 2026
The problem
Your team agreed: no :latest tags. On Friday, someone ships nginx:latest anyway. How do you stop it every time?
Pick one answer.
Watch
A ValidatingAdmissionPolicy: A house rule checked at gate 3, written in CEL. Built into Kubernetes, nothing to install. is a house rule, built into Kubernetes. The rule itself is one line of CEL. Tap it.
Tap the line that holds the rule.
0 of 1 found
Predict
image: nginx has no tag at all. Does this rule stop it?
Pick one answer.
Try it
A policy does nothing alone. A binding says where it runs, and what to do: Deny, Warn or Audit. Put a safe rollout in order.
First step at the top. Put these in order. Use the arrows, or drag.
- Write the policy (the rule)
- Switch the binding to [Deny]
- Bind it with validationActions: [Warn]
- Read the warnings. Fix the old YAML.
Watch
Mei ships nginx:latest after the switch to Deny. Her error ends like this:
ValidatingAdmissionPolicy 'no-latest' with binding 'no-latest-kedai' denied request: Pin a version tag, not latest.Pick one answer.
Try it
Add-ons called policy engine: An add-on rule keeper at gate 3, like Kyverno or Gatekeeper. do more. Sort the three rule keepers.
Drag a card into a box. Or tap the card, then tap the box.
Check
Good rule habit, or risky? Swipe each one.
Swipe right for good, left for needs work. Or use the buttons.
Start new rules with Warn, then switch to Deny
You did it!
You can now write a house rule for gate 3.
Go deeper (optional)
Since Kubernetes 1.36, MutatingAdmissionPolicy is stable too: it changes objects with CEL. failurePolicy: Fail refuses requests when the rule itself breaks. A binding’s matchResources picks zones by label. Kyverno and Gatekeeper run as webhooks: extra pods you keep healthy.
Real mission
kubectl apply -f policy.yamlkubectl create namespace policy-testkubectl run test -n policy-test --image=nginx:latest
0 of 5 steps done · Your ticks are saved.
Bahasa Melayu
Pasukan anda dah setuju: tiada tag :latest. Hari Jumaat, seseorang hantar nginx:latest juga. Macam mana nak halang setiap kali?
ValidatingAdmissionPolicy ialah peraturan rumah, terbina dalam Kubernetes. Peraturan itu sendiri cuma satu baris CEL. Tekan baris itu.
image: nginx tiada tag langsung. Adakah peraturan ini menghalangnya?
Polisi sahaja tak buat apa-apa. Binding tentukan di mana ia berjalan, dan apa tindakannya: Deny, Warn atau Audit. Susun pelancaran yang selamat.
Mei hantar nginx:latest selepas tukar ke Deny. Ralatnya berakhir begini:
ValidatingAdmissionPolicy 'no-latest' with binding 'no-latest-kedai' denied request: Pin a version tag, not latest.
Tambahan yang dipanggil enjin polisi boleh buat lebih. Asingkan tiga penjaga peraturan ini.
Tabiat peraturan yang baik, atau berisiko? Leret setiap satu.
Kini anda boleh tulis peraturan rumah untuk pintu 3.
You finished this before. Practice is always welcome!
Official docs: Validating Admission Policy · CEL in Kubernetes · Kyverno docs · Gatekeeper docs
You've learned for 25 minutes. A short break helps your brain.
Sprint done! Great focus. Stretch for a minute?