OPA Gatekeeper as an alternative
Use OPA Gatekeeper when your organization already standardizes on OPA and writes policy in Rego. Like Kyverno , it runs as an admission webhook, so it checks the platform's requests as well as yours. Read Control admission first for how to scope a webhook so it never blocks the platform; this page covers what is specific to Gatekeeper.
Which tool to use
- Gatekeeper if you have an existing Rego policy library or an OPA practice to reuse. Its model is
ConstraintTemplate(the reusable rule, in Rego) plusConstraint(the rule applied with parameters). - Kyverno if you want YAML-native policies and easy mutate and generate, with no Rego. See Use Kyverno policies .
- A native ValidatingAdmissionPolicy for any rule that must always block, because a webhook engine cannot guarantee that here, as explained below.
Install and write a constraint
Install Gatekeeper with its Helm chart, then define a ConstraintTemplate and a Constraint:
apiVersion: templates.gatekeeper.sh/v1
kind: ConstraintTemplate
metadata:
name: k8srequiredlabels
spec:
crd:
spec:
names: {kind: K8sRequiredLabels}
targets:
- target: admission.k8s.gatekeeper.sh
rego: |
package k8srequiredlabels
violation[{"msg": msg}] {
not input.review.object.metadata.labels["team"]
msg := "every workload must carry a team label"
}
---
apiVersion: constraints.gatekeeper.sh/v1beta1
kind: K8sRequiredLabels
metadata:
name: require-team-label
spec:
match:
kinds:
- {apiGroups: ["apps"], kinds: ["Deployment"]}
Scope Gatekeeper's webhook
Syself Autopilot does not check Gatekeeper's webhook configuration, so keep it inside the rules in Control admission :
- Prefer
failurePolicy: Ignoreon Gatekeeper's webhook. If Gatekeeper is down and its webhook isFail, it blocks every matching request, including the platform's own work on the cluster.Ignoremeans an outage skips the check rather than freezing the API. - Keep
kube-system,kube-node-leaseandkube-publicout of itsnamespaceSelector, for example with Gatekeeper's namespace exemption settings. Blocked cluster operations shows what happens when it reaches them while Gatekeeper is down. - Do not start the name of your own policies with
syself-. The platform uses that prefix.
Why some rules need a native VAP
With failurePolicy: Ignore, Gatekeeper's validation is best-effort: during a Gatekeeper outage, a policy violation can slip through, because the API server was told to allow rather than wait. That is the right trade for cluster availability, and it is why a rule that must never be bypassed, "no privileged pods, ever", belongs in a native ValidatingAdmissionPolicy , which runs inside the API server and cannot be taken offline. Use Gatekeeper for the broad policy set and a native VAP for the few rules that must always hold. Keep Gatekeeper highly available to shrink the best-effort window.
Use Kyverno policies
Install Kyverno on a Syself Autopilot workload cluster, keep its webhooks away from the platform namespaces, configure failurePolicy correctly, and pick the right rule type for mutations, generation, validation, and image signing.
Supply-chain security
How the Syself Linux node image is built from hash-pinned sources with a reproducible seal, what the SPDX SBOM and VEX verdicts let you verify, and exactly what is and is not signed or attested.