How to Configure K3s Admission Controller
You set up a k3s admission controller by passing API server flags at startup. These flags tell the cluster which plugins to run before saving any resource. Most teams start by turning on built-in plugins in the server settings file. They also deploy webhook apps to check custom rules for new pods. Still, broad cluster roles often let engineers bypass these rules during live incidents. When a team has wide admin rights, admission checks cannot stop manual changes. How a k3s admission controller
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.
You set up a k3s admission controller by passing API server flags at startup. These flags tell the cluster which plugins to run before saving any resource. Most teams start by turning on built-in plugins in the server settings file. They also deploy webhook apps to check custom rules for new pods. Still, broad cluster roles often let engineers bypass these rules during live incidents. When a team has wide admin rights, admission checks cannot stop manual changes.
How a k3s admission controller works
K3s bundles the standard Kubernetes API server into a single light binary. Every request to create, edit, or delete an object goes through this server. First, the server checks who sent the request and verifies their role permissions. Next, the k3s admission controller intercepts the request before the database saves it. This process runs in two distinct phases called mutating and validating.
During the mutating phase, controllers can change the object to add default settings. For example, a controller might attach labels or set default memory limits on pods. During the validating phase, controllers check the object against your security rules. If a pod breaks a rule, the controller blocks the request right away. You can use built-in plugins or point the server to external webhook services.
Steps to set up admission rules in K3s
To enable built-in plugins, you edit the main K3s server settings file. You add an API server argument that lists the plugins you want active. After you save the file, you must restart the K3s service on each node. The server reads the new list and starts running those checks right away.
For custom rules, teams deploy a policy engine inside the cluster as a pod. You then create a webhook resource that points the API server to that pod. You also need to manage TLS certificates so the API server trusts the webhook. If the webhook pod goes down, the API server might block all new deploys. Teams must decide whether rules should fail open or fail closed during outages.
K8s Admission Controllers + End-to-End Encryption: architecture patterns and best practices
Continue reading? Get the full guide.
Free. No spam. Unsubscribe anytime.
What admission checks solve and what they miss
Admission controllers are great at keeping bad pod specs out of your cluster. They stop teams from running root containers or skipping resource limits on new apps. They also enforce naming rules and require specific labels on every new deployment.
Still, admission checks only run when someone creates or updates a cluster object. They do not watch interactive commands that engineers run inside existing containers. If a user opens a shell into a running pod, admission rules do nothing. Also, admission webhooks do not inspect direct database queries or mask sensitive data. When a script reads customer emails or card numbers, admission plugins stay silent. Teams still need a way to govern live sessions and protect raw data.
Govern kubectl and API calls in flight
Identity providers and Kubernetes RBAC decide who logs into a cluster. They cannot redact keys inside returned JSON objects or hold a risky delete call for review. By design, hoop.dev sits inline as an open-source proxy, a sidecar for your Kubernetes API, without replacing RBAC. On every production call from an engineer or AI agent, hoop.dev decides to pass, mask, block, or hold it for human approval.
First, hoop.dev guardrails refuse banned methods, paths, or headers before they run or hold risky deletes for review. Next, hoop.dev data masking rewrites sensitive keys in returned Secret, ConfigMap, and log responses in memory, and writes each decision to the audit trail. Explore the repo on GitHub.
Frequently asked questions
Does K3s enable any admission plugins by default?
Yes, K3s turns on several standard admission plugins out of the box. These default plugins handle basic tasks like namespace life cycles and service account tokens.
How do I check which plugins are active in my cluster?
You can check the K3s service logs on your server node after startup. The API server prints the full list of active admission plugins during boot.
Can an admission webhook block my whole K3s cluster?
Yes, a broken webhook with a strict failure rule will block new pods. You should exclude system namespaces so core cluster apps can always start up.
Related guides
In this post