spec.image and spec.replicas before the controller ever sees the object.
If a CEL expression evaluates to true, the API server may allow the request to continue. If it evaluates to false and the associated binding enforces deny, the API server rejects the request and returns the policy’s validation message.

- Images must not use the mutable
:latesttag, because moving tags reduce repeatability and make rollouts unpredictable. - Explicit replica counts must be within a supported range so extreme values are rejected before the controller begins reconciling.
This demo includes a ValidatingAdmissionPolicy and a matching ValidatingAdmissionPolicyBinding for these rules. You’ll see two test cases: applying an invalid WebApp manifest (to observe rejection) and applying a valid manifest (to observe acceptance). The provided policy manifest uses placeholders so you can insert the CEL expressions and validate the API server behavior.
Example fragment in the policy manifest where you fill in CEL expressions:
Policies and bindings are distinct: policies hold logic and messages, while bindings control scope and enforcement. This lets you stage validation rules in the cluster before applying them to requests.
- Validating Admission Policies: https://kubernetes.io/docs/reference/access-authn-authz/admission-controllers/#validatingadmissionpolicy
- Common Expression Language (CEL): https://opensource.google/docs/cel/