Course contentsShow
← Cloud and Infrastructure
Lesson 1406 of 2,98928. Kubernetes SecurityFree lesson

Admission Controller Types

Distinguishing between validating and mutating admission controllers and their execution order in the admission chain.

Admission Controller Types

You'll learn the two fundamental categories of admission controllers—validating and mutating—and how Kubernetes sequences them to enforce policy and modify requests.

The Two Types

Admission controllers in Kubernetes come in two flavors:

Mutating admission controllers modify incoming API requests. They can add, change, or set default values in objects before they're persisted. Think of them as helpful assistants who fill in missing information on a form before submission—like automatically adding sidecar containers or injecting environment variables.

Validating admission controllers inspect requests and approve or reject them based on policy rules. They never change the request; they simply say "yes, this is allowed" or "no, this violates policy." Think of them as security guards checking IDs at the door.

The Admission Chain Order

Here's the critical part: mutating controllers always run before validating controllers. This sequence makes logical sense—you want to finish modifying an object before checking if it meets all requirements.

The flow looks like this:

  1. API request arrives
  2. Authentication and authorization checks pass
  3. Mutating admission controllers execute (in undefined order among themselves)
  4. Object schema validation occurs
  5. Validating admission controllers execute (in undefined order among themselves)
  6. Object is persisted to etcd

Some admission controllers are both mutating and validating—they'll run twice, once in each phase.

Why This Matters

Understanding this ordering prevents confusion. For example, if a mutating webhook adds a required label, a validating webhook checking for that label will see it—because mutation happened first. Reversing this order would cause validation failures.

Key Takeaway: Mutating admission controllers modify requests and always run before validating admission controllers, which only accept or reject requests without changes—this two-phase approach ensures consistent policy enforcement.