How to Configure AKS Admission Controller
To set up an aks admission controller, register a webhook with the Kubernetes API server. The server sends API requests to your service after a user logs in and passes role checks. Teams often begin by granting roles across namespaces so engineers can ship apps fast. When those roles are too broad, users can create pods with risky settings or view sensitive subresources. How an aks admission controller works with Kubernetes RBAC Every request to the Kubernetes API server goes through a clear
Your coding agents run with your access.
Claude Code reaches prod with a developer's credentials, and approval prompts get clicked through. hoop.dev checks every query, masks sensitive data, and holds risky changes for a human.
To set up an aks admission controller, register a webhook with the Kubernetes API server. The server sends API requests to your service after a user logs in and passes role checks. Teams often begin by granting roles across namespaces so engineers can ship apps fast. When those roles are too broad, users can create pods with risky settings or view sensitive subresources.
How an aks admission controller works with Kubernetes RBAC
Every request to the Kubernetes API server goes through a clear sequence of checks. First, the server verifies the caller identity. Next, Kubernetes RBAC checks whether the user holds the right permissions. In Kubernetes, a Role sets permissions inside one namespace. A ClusterRole sets permissions across the whole cluster, including nodes and all namespaces.
A RoleBinding links a user or group to a Role inside one namespace. A ClusterRoleBinding grants those permissions across the entire cluster. All permissions in Kubernetes RBAC are additive, meaning there are no deny rules. Once RBAC approves the call, the aks admission controller runs before the server saves the object.
Admission controllers work in two distinct phases. Mutating controllers run first and can change the object being sent. For example, they can add labels or set default resource limits on a pod. Validating controllers run second and check the object against your team rules. If a request breaks a rule, the controller rejects the API call right away.
Setting up webhook rules and certificates
To run a custom admission webhook in your cluster, you deploy a service inside a namespace. The API server must trust this service over TLS. You create a TLS certificate and attach the public bundle to your webhook registration object. Then you define which API groups, versions, and operations should trigger the webhook check.
For example, you can match create and update calls on pods or deployments. You also choose a failure policy for the webhook. This setting tells the API server whether to reject or allow requests if the webhook service goes down. Teams must monitor webhook latency so slow checks do not delay normal cluster operations.
K8s Admission Controllers + AKS Managed Identity: architecture patterns and best practices
Continue reading? Get the full guide.
Free. No spam. Unsubscribe anytime.
What native admission controls solve and what they miss
An aks admission controller is great for checking resource specs when objects are created or updated. It stops pods that lack resource limits or pull images from unknown registries. It also fills a major gap in Kubernetes RBAC by acting as a deny rule for bad specs. Still, admission checks only inspect the API object metadata and spec at the moment the call arrives.
This leaves an operational gap during live debugging and day-to-day cluster maintenance. Kubernetes treats pod logs and pod exec sessions as subresources in the API URL. Once RBAC and admission checks allow an exec call, the API server opens a stream. Native admission webhooks do not inspect the shell commands an engineer runs inside that container.
They also do not rewrite sensitive data like emails or card numbers returned in pod logs. If an engineer has broad role bindings, they can run risky commands inside production pods. Native controls decide who starts the session, not what individual commands do in flight.
Add request guardrails and response masking beside Kubernetes
Cluster roles and service accounts govern who reaches the Kubernetes API. Still, a broad role or agent can delete workloads or print sensitive values from ConfigMaps and logs. In practice, hoop.dev sits inline beside the API server as a sidecar for your Kubernetes API. For every production API call an agent or human sends, hoop.dev decides whether to pass, mask, block, or escalate it for review alongside RBAC.
With hoop.dev Kubernetes controls, guardrails allow listing Secret names while refusing reads of Secret data before execution, and data masking redacts matched keys in returned JSON responses and log streams in memory. Furthermore, hoop.dev holds SOC 2 Type II and is MIT licensed on GitHub.
Frequently asked questions
What is the difference between Kubernetes RBAC and an admission controller?
Kubernetes RBAC checks who is making the API call and which verbs they can use. It only grants additive permissions and has no deny rules. An admission controller runs after RBAC to inspect, change, or block the actual object content.
Can an aks admission controller block commands inside a running pod?
An admission webhook can approve or block the initial request to start an exec subresource session. Still, once that stream opens, the admission controller cannot see or block individual shell commands run inside the pod.
What happens if an admission webhook service stops responding?
The outcome depends on the failure policy you set on the webhook registration object. The API server will either reject all matching requests to stay safe or allow them through to keep workloads running.
Related guides
In this post