Dynamic Admission Control
What you'll learn: How dynamic admission controllers use webhooks to enforce custom policies in Kubernetes without modifying the cluster's core code.
What Is Dynamic Admission Control?
While built-in admission controllers provide standard validation and mutation logic, dynamic admission control lets you extend Kubernetes with custom policy enforcement through webhooks. Think of it as a plugin system: instead of recompiling Kubernetes to add new rules, you write your own HTTP service that Kubernetes calls to approve or modify resource requests.
How It Works
When you create or update a resource, Kubernetes can send an admission request to your external webhook service. Your service examines the request and responds with one of three actions:
- Allow — Let the request proceed unchanged
- Deny — Reject the request with a custom error message
- Mutate — Modify the request (add labels, inject sidecars, etc.)
There are two types of dynamic admission webhooks:
MutatingAdmissionWebhook
Runs first, allowing your service to modify incoming resources. For example, automatically adding sidecar containers or injecting environment variables.
ValidatingAdmissionWebhook
Runs after mutation, letting you enforce policies. For example, rejecting Pods that don't meet security standards or ensuring all Deployments have resource limits.
Why It Matters
Dynamic admission control is the foundation for powerful policy engines like OPA Gatekeeper and service mesh injection tools like Istio. It enables organization-specific governance without forking Kubernetes itself.
Key Takeaway: Dynamic admission controllers use webhooks to enforce custom validation and mutation logic at admission time, enabling flexible policy enforcement without modifying Kubernetes source code.