Kubernetes Admission Control: Enforcing Policy Before Workloads Reach Production

Content authorBy Irina BaghdyanPublished onReading time14 min read
Glowing transparent blue digital shield protecting a futuristic network infrastructure, surrounded by orange cybersecurity warning icons and floating data interfaces, representing threat detection, ne

Kubernetes admission control can catch a bad configuration before it reaches the cluster, but it can also block every deployment if it is placed or rolled out badly. Know where it sits in the Kubernetes request path, then decide which safeguards belong at that point and which are better handled elsewhere. Choose an enforcement mechanism to match, and sequence the rollout in stages so new rules do not stall the deployments they are meant to protect.

Why the admission path is the cheapest place to say no

Kubernetes admission control is the last point where a bad configuration can be stopped before it becomes a running workload. After that, you're doing incident response instead of validation. Red Hat's 2024 survey of 600 DevOps and security professionals found that 40% detected misconfigurations in their container or Kubernetes environments in the previous 12 months, and nearly nine in ten had at least one security incident.

The problem for most platform teams is sequencing. Turn on too much too quickly and you break deployments for teams who had no warning. Turn on too little and the control exists on paper only. What follows is a way to order the work: pick the enforcement layer that matches your requirements, then rank policies by what a failure actually costs the business.

How Kubernetes admission control works

Every write to the Kubernetes API server travels the same route. Authentication establishes who you are and authorization decides whether you're permitted to act. Then admission controllers inspect the object before anything is written to etcd. Kubernetes admission control is that third stage, and it's the only one that looks at the content of what you're creating rather than the identity behind it. These security controls help prevent unsafe configurations from reaching production.

The stage splits in two. Mutating admission runs first and modifies the request, so it can inject a sidecar or replace an image tag with a digest. Validating admission runs after the object has been through schema checking, and it can accept or reject the request.

The ordering matters more than it looks. Because mutation happens before validation, a mutating policy can supply a default that a validating policy then checks, which gives you a way to fix the easy cases automatically and block only the ones that need a human decision. A denial here never reaches etcd, so there's nothing to clean up afterward.

Choose enforcement mechanisms

Futuristic neon infographic on Kubernetes Enforcement Mechanisms, featuring glowing nodes, icons, and a vibrant timeline on a blue gradient background.

Most production clusters end up using more than one mechanism, so the decision is how much operational surface you're willing to add for each control. Treat native admission controls as the preferred starting point. Use built-in admission controllers and native CEL policies wherever they satisfy the requirement, and add a policy engine or custom webhook when you need something they don't provide.

  • Built-in admission controllers, such as Pod Security Admission, LimitRanger, and ResourceQuota, that ship with the API server and need configuration rather than installation

  • Native CEL-based Kubernetes admission policies (ValidatingAdmissionPolicy and MutatingAdmissionPolicy), evaluated in-process, covering both validation and many mutation use cases without external webhooks

  • An established policy engine such as Kyverno or OPA Gatekeeper, which adds a webhook deployment but can bring a broader policy lifecycle, reporting, image verification, external context, and cross-platform policy (capabilities vary by engine)

  • Custom admission webhooks you write and operate yourself

Start at the top of that list and move down only when a requirement isn't met. Every step down adds something to the critical path of every API write in scope, and that cost is paid continuously. Before writing custom logic, ask whether the layer above it already does the job. DevSecOps practices can also help move policy checks earlier in the delivery process.

Built-in and native controls

Pod Security Admission reached stable in Kubernetes v1.25, the same release that removed PodSecurityPolicy. It enforces the Pod Security Standards at the namespace level through labels, which makes it a strong native baseline. For a cluster with no pod-level enforcement, applying the restricted profile to production namespaces, after a trial in audit or warn mode, is a sensible first step.

Alongside it, LimitRanger applies default and maximum container resource settings per namespace, and ResourceQuota caps aggregate consumption. Neither needs a webhook, and both have long been available in Kubernetes, which makes them straightforward additions to a baseline.

ValidatingAdmissionPolicy became stable in Kubernetes v1.30 and uses Common Expression Language to declare rules the API server evaluates in-process. Google's engineering team described the change as a way to replace many admission webhooks with policies evaluated directly in the kube-apiserver. For label requirements and registry allowlists, that is often sufficient Kubernetes admission control, with nothing extra to run or certify. MutatingAdmissionPolicy, stable in Kubernetes 1.36, extends the same approach to mutation. Native CEL policies can now handle both validation and many mutation use cases, such as setting defaults, without an external webhook. The broader Kubernetes concepts provide useful context for how these native capabilities fit into the platform.

Need IT Support?

Book a free consultation with ABS Technologies experts we'll help you find the right managed IT, cloud, or security solution for your business.

Book a Free Consultation →

Admission webhooks

A custom webhook earns its place when the decision needs context the API server doesn't have, such as a lookup against an internal service catalog, or logic that can't be expressed in CEL. Custom webhooks add availability, latency, scaling, and lifecycle responsibilities.

The obligations are concrete. timeoutSeconds accepts values between 1 and 30 and defaults to 10, which is a long wait for a call in the write path of every matching request, so set it from measured latency. failurePolicy defaults to Fail, so an unreachable webhook rejects the matching operation outright. You also own the replica count and the namespace scoping that keeps the webhook from intercepting the pods it needs to run itself.

That last point is a known failure pattern. Suppose a validating webhook matches pod creation in its own namespace, with failurePolicy set to Fail and a single replica. If that replica is lost, the API server can't reach the webhook, the replacement pod is rejected, and the service can stay down. Kubernetes recommends excluding a webhook's dependencies from its matching rules and avoiding circular admission dependencies. Scope narrowly with namespaceSelector, and explicitly exclude the webhook's own namespace and other critical dependencies.

Kyverno vs OPA Gatekeeper

Both are CNCF graduated projects. Open Policy Agent graduated in 2021, and Kyverno graduated from CNCF in March 2026, after a third-party security audit and governance review.

Kyverno writes policies as Kubernetes custom resources in YAML, with CEL now the direction of travel. Gatekeeper uses Rego inside a ConstraintTemplate, instantiated by Constraint resources. Gatekeeper's mutation support has been stable since v3.10 through Assign and AssignImage. Kyverno additionally generates resources and verifies container image signatures natively, which Gatekeeper leaves to external integration.

Testing workflows differ in shape but not in availability. Gatekeeper ships the gator CLI for unit-testing constraints locally against test suites, and Kyverno has its own CLI plus Chainsaw for end-to-end checks. Both can audit resources already running in the cluster. Kyverno generates Kubernetes PolicyReport resources, while Gatekeeper reports audit results differently, so confirm that its output fits your reporting workflow.

So the Kyverno vs OPA Gatekeeper decision depends on several factors rather than a single rule: your team's skills (Rego, or YAML and CEL), your existing policy ecosystem, mutation and generation requirements, image verification, reporting needs, external policy data, and whether the same policies must govern other platforms such as Terraform plans or CI pipelines. Where Rego is already established across those platforms, one engine can consolidate real work. Where scope is mostly Kubernetes and the team is fluent in YAML and CEL, Kyverno may be the more natural fit. Nirmata's feature comparison is a fair starting point, written by Kyverno's commercial backer, which you should read with that in mind.

Prioritize Kubernetes admission policies

Rank candidate controls by what a failure costs. The goal is a minimum baseline you can defend in an audit and explain to a product team in one sentence each, before you expand into broader governance.

Workload security

Privileged containers should normally be prohibited unless explicitly required and approved, because a privileged pod removes much of the container isolation and gives a compromised process a path to the node. Root execution and allowPrivilegeEscalation belong in the same priority tier. The Pod Security Standards baseline profile prevents known privilege escalations, so adopt it rather than reinventing the rule set.

Above baseline, the restricted profile adds non-root enforcement, privilege-escalation controls, and capability dropping. Read-only root filesystems and explicitly approved security contexts come next, and they're where you'll meet resistance from workloads that write to disk out of habit. These Kubernetes admission policies are worth the negotiation because they shrink what an attacker can do after an initial foothold.

Image trust

Restricting pulls to approved registries is a practical supply chain control because it narrows where workloads can come from. Mutable tags are the next problem: :latest means the image running today isn't the image you tested.

  • Allowlist registries and reject anything outside them

  • Block mutable tags and pin to digests, or mutate the tag into a digest at admission

  • Set a vulnerability threshold tied to your scanner's output rather than a blanket "no highs" rule nobody can meet

  • Verify trusted signatures and build provenance (for example, Cosign signatures) for images produced by your own pipelines, where your organization has implemented a signing model

Signing only helps if the cluster verifies it, so admission is where that signing model gets enforced. Kyverno's ImageValidatingPolicy handles signature verification against a Cosign key or keyless OIDC identity. One caution: any policy that reaches a registry at admission time puts an external network call in your write path, so set a deliberate timeout and decide in advance what happens when the registry is slow.

Need IT Support?

Book a free consultation with ABS Technologies experts we'll help you find the right managed IT, cloud, or security solution for your business.

Book a Free Consultation →

Resource governance

Requiring CPU and memory requests on every container improves scheduling quality, because requests are the scheduler's primary resource-planning input. Missing or inaccurate requests reduce scheduling and capacity-planning quality, and a workload without limits can crowd out its neighbors on the same node. Memory limits help contain a leak before it affects everything co-located with it.

Pair kubernetes admission control requirements with ResourceQuota per namespace so a single team can't consume the cluster. Avoid prescribing specific values in the policy itself. Require that requests exist and that limits are present where they matter, then let teams size their own workloads.

Ownership metadata

Labels for owning team and application sound like paperwork until the first production incident where nobody knows who to page. The recommended labels in the Kubernetes documentation give you a naming convention that tooling already understands.

Mutation is appropriate where a safe default exists and the value is derivable, such as stamping an environment label from the namespace. Validation should reject anything ambiguous: if the policy would have to guess which team owns a workload, make the human supply the answer. Kubernetes admission policies that quietly invent ownership data are worse than no labels, because the chargeback report looks correct and isn't.

Design controlled exceptions

Every policy program ends up with exceptions. The failure mode is making them permanent in the form of a bypass label that someone added during an outage, and nobody removed. Six months later, the cluster has holes nobody can enumerate.

Kyverno's PolicyException resource decouples the exemption from the policy, so the rule stays strict, and the bypass becomes a separate object with its own audit trail. Scope each one to a named workload or namespace and a specific rule, never to a whole policy. Record the owner, the reason, and the expiry date.

Expiry needs enforcement. Kyverno's own policy library includes a pattern that generates a ClusterCleanupPolicy to delete an exception automatically once its window closes, which turns a review reminder into a mechanism. Whatever engine you run, keep the exception list reviewable in Git, with an owner, scope, reason, and expiry recorded for each entry.

Test before enforcement

Nothing about Kubernetes admission control is safe to deploy untested, because the blast radius of a bad policy is every deployment in its scope. Start with unit tests against representative manifests, which include the ones you expect to fail, and run them in CI pipelines on every policy change.

Then test against reality. Server-side dry run sends a request through the full kubernetes admission control chain without persisting it, which tells you how the API server behaves rather than how your test harness does. Run an audit pass over resources already in the cluster before enforcing anything, because that inventory is your rollout plan.

Write the rejection messages for the developer who hits them at 5 p.m. on a Friday. A message that names the field and the expected value resolves itself. "Policy violation" generates a ticket for your team.

Roll out safely

Start in audit or warn mode and leave it there long enough to see a full release cycle. ValidatingAdmissionPolicy bindings accept Warn and Audit as validation actions before you switch to Deny, and both Kyverno and Gatekeeper have equivalent non-blocking modes. Expand by namespace from a test namespace outward as the impact becomes clear and affected teams are ready.

A few operational decisions determine whether enforcement survives contact with production:

  1. Run webhook replicas across nodes with a pod disruption budget, and treat the policy engine as a tier-zero service

  2. Set short timeouts based on measured latency

  3. Choose fail-open for advisory checks and fail-closed only where a missed check causes harm you can't reverse

  4. Scope policies explicitly, and carefully validate any exclusions for system namespaces and the policy engine's own workloads. Some policies may intentionally need to protect system namespaces

  5. Alert on admission latency and rejection rate, with a documented rollback that disables or reverts the offending policy or binding

Decide your rollback trigger before you need it. A sustained spike in rejections across unrelated teams is a signal to investigate. It can mean the policy is wrong, or it can reflect a coordinated platform or application change. Setting failurePolicy to Ignore is not a universal rollback, so treat fail-open as an emergency option whose suitability depends on the risk of the control. Policy engines that run as admission webhooks carry the same availability and latency considerations, whichever you picked in the Kyverno vs OPA Gatekeeper comparison. A rollback the team has rehearsed makes it easier to expand enforcement with confidence.

Build the implementation roadmap

Begin with an inventory. List every admission controller and webhook configuration currently active in Kubernetes admission control, because third-party installers register webhooks you didn't write. Then rank the gaps against the baseline above by what a failure would cost and sequence the rollout so the highest-risk controls go first and the governance work follows.

Kubernetes admission control is a program, not a one-time setup. Assign an owner to the policy set the way you would for a service, and review your policy engine and architecture choices as Kubernetes capabilities evolve. As Jim Bugwadia, co-creator of Kyverno and CEO of Nirmata, put it, policy-as-code provides "the essential guardrails" for governance at scale without stifling innovation. Guardrails only work if people stay on the road.

Where to start this quarter

Pick the three highest-risk gaps and run them in audit mode. That exercise shows where your real exposure is before you commit to enforcement. Audit first and enforce second. Move to enforcement when the impact is understood, exceptions are controlled, remediation paths exist, and affected teams are ready.

ABS Technologies designs and operates Kubernetes platforms for software companies scaling production delivery, which includes containerization and CI/CD pipeline automation. Talk to our team about an assessment and a prioritized roadmap for Kubernetes admission control in your clusters.

Need IT Support?

Book a free consultation with ABS Technologies experts we'll help you find the right managed IT, cloud, or security solution for your business.

Book a Free Consultation →

Kubernetes admission control applies to API requests that create, update, or delete resources, but it doesn't govern read-only requests. Authentication and authorization still happen first. Admission evaluates only requests that match a controller or policy's configured scope, so an active rule won't affect every object automatically.

Review ValidatingWebhookConfiguration, MutatingWebhookConfiguration, ValidatingAdmissionPolicy, and namespace security labels. Check each rule's resource and namespace selectors, then identify the service account and owner behind every external webhook. This inventory can reveal controls installed by Helm charts or platform tools before you change cluster policy.

The result depends on its failure policy. With fail-closed behavior, the API server rejects matching requests while the webhook is unreachable, and the object isn't stored. With fail-open behavior, the request can continue without that check. Choose between availability and enforcement according to the harm a missed decision could cause.

No. Admission policies check configuration before Kubernetes stores an object, but they don't monitor later changes inside a running container. Use runtime detection, network controls, and workload security settings for activity after startup. Keep admission rules focused on decisions that are available from the API request itself.

A named platform or security owner should maintain the policy source, tests, exceptions, and rollback process. Product teams should review rules that affect their deployments, while the owner tracks violations and policy changes. ABS can assess your current controls and roadmap through its [contact page](https://abs.am/contact/).

Schedule a Meeting

Book a time that works best for you and let's discuss your project needs.