An admission controller is Kubernetes code that runs when an object is created, before the object is accepted. It can enforce a cluster-wide rule instead of relying on every developer to configure each Pod manually. section 12.5
Admission webhooks perform two kinds of enforcement:
- Validating admission webhooks accept or reject an object, such as rejecting a Pod without runAsNonRoot. section 12.5
- Mutating admission webhooks change an incoming object, such as adding runAsNonRoot: true automatically. section 12.5
- You can write custom admission controllers, or use Kubernetes-provided, open source, or commercial controllers. section 12.5
Enforcing non-root Pods
A cluster can automatically add the non-root setting to every Pod or reject Pods that omit it. This centralizes a security requirement that would otherwise be configured manually. The resulting Pod still needs a compatible image and user configuration; an image that runs as root or binds to port 80 can fail, requiring runAsUser: 1001, a non-privileged port such as 8080, and an updated Service targetPort. section 12.5 section 12.4
Trace how a Pod request passes through admission before it is scheduled. section 12.5


