$linuxjunkies
>

mutating webhook

also: admission webhook, mutating admission webhook

A Kubernetes extension that automatically modifies or transforms API requests before they are persisted, such as injecting environment variables, adding labels, or modifying pod specifications.

A mutating webhook is a Kubernetes admission controller that intercepts API requests and modifies the request object before it's stored in etcd. When you submit a resource like a Pod or Deployment, the API server sends it to the webhook, which can alter the specification before the resource is created.

Mutating webhooks are commonly used to automatically inject sidecar containers, set default resource limits, add labels and annotations, or enforce organizational policies without requiring users to manually specify these details. For example, a webhook might automatically inject a logging sidecar container into every Pod created in a namespace.

Unlike validating webhooks which only accept or reject requests, mutating webhooks actively transform the request. A resource can have both mutating webhooks (which run first) and validating webhooks (which run after mutations are complete) configured in sequence.

Related terms