Admission control is the step where the Kubernetes API server checks or modifies an object (such as a Pod or Deployment) before saving it, and can reject it, change it, or both. With it you enforce cluster-wide rules on every object before it is saved: "no privileged pods," "images must be signed," or "every Deployment needs a cost label." The same rules also apply to every request the platform makes, so a rule written for your workloads can stop node replacements and upgrades just as well. From 1.37 on, Syself Autopilot leaves that choice to you: it does not restrict which webhooks you register, and it loads one admission policy of its own, for network-policy rules the platform cannot enforce. ## How a broken webhook can stop your cluster An admission webhook is a pod that the API server calls on every matching request. A `ValidatingWebhookConfiguration` is a Kubernetes object that connects that pod to the admission process. If you register one with `failurePolicy: Fail` and the pod becomes slow or unreachable, the API server rejects every request it cannot check. That includes the requests of the components that run your cluster: the kubelet on every node, the controller manager and the scheduler, Cilium, and the management cluster that joins, replaces and upgrades nodes. RBAC (Role-Based Access Control) does not help here. `system:masters`, its most privileged group, skips RBAC checks but not admission webhooks, so a webhook with `failurePolicy: Fail` blocks everyone. Your own ValidatingAdmissionPolicies and MutatingAdmissionPolicies have no pod to go down, but a policy that rejects or rewrites the platform's pods stops the platform in the same way. What breaks depends on what the webhook or policy matches. [Blocked cluster operations](/docs/hetzner/apalla/clusters/troubleshooting/blocked-cluster-operations) lists each symptom, from an upgrade that never starts to a cluster that stops changing while every node shows `Ready`, and how to find the cause. ## What Kubernetes protects on its own Kubernetes keeps you able to recover from a broken webhook or policy: - It never sends a request for a `ValidatingWebhookConfiguration`, a `MutatingWebhookConfiguration`, an admission policy or a policy binding to a webhook. You can always delete them, even while a broken webhook rejects everything else. - It never sends a TokenReview, SubjectAccessReview or any other access review to a webhook, whatever the webhook's rules say. Authentication and authorization keep working, so you can still log in to delete the webhook. Until 1.36, Syself Autopilot also rejected tenant webhooks that targeted platform resources with `failurePolicy: Fail`. From 1.37 on it does not. That check mostly rejected the default configuration of tools such as Kyverno, whose policies then stopped enforcing without an error anywhere but in the tool's own logs. From 1.37 on, platform policies load from the sealed node image, so a check that rejected a harmless webhook could only have been fixed with a new node image. What remains is the risk the check was meant to cover: a webhook or policy that blocks the platform until you remove it. Writing your rules as described below keeps that from happening. ## Write webhooks and policies that never block the platform Most admission rules only need to check your own workloads. Scope them to your namespaces and they never touch the platform's requests: - Use `failurePolicy: Ignore` for any webhook that matches broadly. When its backend is down, requests go through instead of failing. - Give every `Fail` webhook a `namespaceSelector` that leaves out `kube-system`, `kube-node-lease` and `kube-public`: ```yaml namespaceSelector: matchExpressions: - key: kubernetes.io/metadata.name operator: NotIn values: [kube-system, kube-node-lease, kube-public] ``` - Never use `failurePolicy: Fail` on cluster-scoped resources or on requests that no selector can scope: `nodes` and `nodes/status`, `leases`, `certificatesigningrequests`, `pods/eviction`, `pods/binding`, `serviceaccounts/token`, the `cilium.io` resources, and wildcards such as `apiGroups: ["*"]` or `resources: ["*/*"]`. - Do not match the `CONNECT` operation on `pods/portforward`, or use `pods/*`, with `failurePolicy: Fail`. The management cluster reaches etcd through a port-forward. - Scope your own ValidatingAdmissionPolicies and MutatingAdmissionPolicies the same way, with a `namespaceSelector` under `spec.matchConstraints` in the policy or under `spec.matchResources` in the binding. A policy that rejects privileged pods or adds a `nodeSelector` must leave `kube-system` out, because the platform's own pods there are privileged and run on every node. - Run a webhook's backend with several replicas spread across nodes and a PodDisruptionBudget, so a node drain never takes all of it down at once. - Do not start the name of your own webhooks or policies with `syself-`. The platform uses that prefix. ## The platform's admission policy The platform loads one ValidatingAdmissionPolicy, `syself-restrict-l7-proxy-policies`, from a file in the sealed node image. It runs inside the API server, so there is no pod to take down, and because it is not an API object, it does not show up in `kubectl get validatingadmissionpolicies` and nobody can change or delete it through the API, cluster admins included. Its name ends in `.static.k8s.io`, the suffix Kubernetes gives every policy it loads from a file. The policy rejects the `CiliumNetworkPolicy` and `CiliumClusterwideNetworkPolicy` rules that cannot be enforced correctly on this platform, because each of them routes matched traffic through a userspace proxy on the node instead of letting the kernel handle it directly. Its parts do not all mean the same thing: | Rule | Where | Status | | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------- | -------------------- | | Application-layer rules: `rules.http`, `rules.kafka`, `rules.l7proto`, `rules.l7`, and the `listener`, `serverNames`, `terminatingTLS` and `originatingTLS` fields next to them | `CiliumClusterwideNetworkPolicy` | Rejected permanently | | The same rules | `CiliumNetworkPolicy` (namespaced) | Rejected for now | | DNS rules: `toPorts[].rules.dns`, and `toFQDNs`, which needs one | Both kinds | Rejected for now | The permanent one is a deliberate design choice, not a bug we are working around: a cluster-wide policy applies to every namespace at once, so one application-layer rule would put every matching connection in the cluster through request-level parsing, including workloads whose owners never saw the policy. If application-layer rules become available here, they will be available in a namespaced policy only. The other two are temporary and lift on their own schedules. Syself re-evaluates these gated capabilities with each new Kubernetes minor release. Layer 3 and Layer 4 rules (workload identity, IP ranges, entities, and ports) are not affected by any part of this policy and are enforced normally in both kinds. See [Segment with network policies](/docs/hetzner/apalla/security/segment-with-network-policies) for what to write instead while the temporary parts are in force. The policy uses `validationActions: [Deny]` and has no exemption: it applies to every caller, cluster admins and platform components included. When you apply an object that violates it, the API server rejects the apply with a `Forbidden` error naming the policy. The object is never created. When a cluster upgrades from 1.36, the policy comes with the new nodes. After the last node has rolled, the platform deletes the admission policies that 1.36 applied through the API, `syself-restrict-tenant-webhooks` among them. Until then, both sets apply. ## Running your own admission policies You can enforce your own policies in two ways. The choice determines how strongly they block. ### Use ValidatingAdmissionPolicy for hard gates A native ValidatingAdmissionPolicy (VAP) is a policy written in CEL (Common Expression Language, a compact rule language built into Kubernetes) that runs inside the API server. It has no backend pod to go down, so it does not carry the reliability trade-off that a webhook-based tool does. A native VAP can hard-deny (fail closed) and cannot be taken offline by a failing pod. For rules that must block without exception, such as "reject privileged pods, always," write a native VAP, scoped as described in [Write webhooks and policies that never block the platform](#write-webhooks-and-policies-that-never-block-the-platform). ### Webhook-based tools are a trade-off Tools like Kyverno and [OPA Gatekeeper](/docs/hetzner/apalla/security/opa-gatekeeper-alternative) use a `ValidatingWebhookConfiguration` to validate resources, so they are only as reliable as their backend pods. With `failurePolicy: Fail`, an outage of the tool blocks every request its rules match. With `failurePolicy: Ignore`, the same outage lets those requests through unchecked. Practical guidance: - Use Kyverno mutate and generate rules freely, scoped to your namespaces. - For rules that must hard-block without depending on a pod staying up, write a native VAP in CEL instead of a Kyverno validating policy. - If you want validation that never blocks your workloads during an outage of the tool, run it with `failurePolicy: Ignore` and keep the tool highly available so that path rarely triggers. See [Use Kyverno policies](/docs/hetzner/apalla/security/use-kyverno-policies) for Kyverno-specific guidance. ### Webhooks served from the host network The API server reaches a webhook pod through the cluster's reverse tunnel. On a node's own IP address, the tunnel lets the API server dial only the kubelet port, plus etcd on control planes. A webhook or aggregated API served from a `hostNetwork: true` pod is therefore unreachable. With `failurePolicy: Fail`, every request it matches is rejected. With `Ignore`, those requests pass unchecked. A webhook served from an ordinary pod needs nothing. For a host-network webhook, declare its port in the `apiserverEgressHostPorts` cluster variable so the API server can reach it. See [API server-to-webhook connectivity](/docs/hetzner/apalla/security/api-server-to-webhook-connectivity). ## What the platform already enforces Beyond the network-policy rules above, the API server runs every admission plugin Kubernetes enables by default, plus two more: **NodeRestriction**: a node agent can only modify its own node and its own pods. It cannot touch other nodes or pods on other nodes. **EventRateLimit**: caps how many events per second the API server records. This stops a misbehaving workload from flooding the API server with events. ## Related - [Blocked cluster operations](/docs/hetzner/apalla/clusters/troubleshooting/blocked-cluster-operations) - [Use Kyverno policies](/docs/hetzner/apalla/security/use-kyverno-policies) - [API server-to-webhook connectivity](/docs/hetzner/apalla/security/api-server-to-webhook-connectivity) - [OPA Gatekeeper as an alternative](/docs/hetzner/apalla/security/opa-gatekeeper-alternative) - [Enforce Pod Security Standards](/docs/hetzner/apalla/security/enforce-pod-security-standards) - [Manage access and tenancy](/docs/hetzner/apalla/security/manage-access-and-tenancy) - [Verify image signatures](/docs/hetzner/apalla/security/verify-image-signatures) - [Security architecture](/docs/hetzner/apalla/security/security-architecture)