Skip to content

Linux Foundation Black Friday Sale: Up to 65% off Save now

Back to the blog
CNCF projects7 min read

What is Kyverno? Kubernetes policy engine explained

Sajeeva Nambadawa Vithanage28 Nov 2026 · Senior Software Site Reliability Engineer

What is Kyverno? It's a policy engine for Kubernetes: you write rules in YAML and CEL, and Kyverno checks, changes or creates resources as they reach the API server. It's a CNCF graduated project, and it has its own certification, the Kyverno Certified Associate (KCA).

There's one thing to know before you follow any tutorial. Kyverno 1.20, released on 12 November 2026, removed the old ClusterPolicy engine. A lot of the Kyverno examples online still use it. This post uses the current policy types, so the example works on today's release. Our Kyverno project page has the project's links and every post we've written about it.

Key points

  • Kyverno is a policy engine for Kubernetes: it can validate, mutate, generate and clean up resources, and verify container images.
  • It joined the CNCF in November 2020, moved to incubating in July 2022 and graduated in March 2026.
  • Since Kyverno 1.20, policies use CEL-based types such as ValidatingPolicy; the legacy ClusterPolicy no longer runs.
  • The Kyverno Certified Associate (KCA) is a 90-minute, multiple-choice exam; "Writing Policies" is its largest domain at 32%.

What is Kyverno and what problem does it solve

Every cluster has rules that aren't in the Kubernetes API itself. Every workload needs an owner label. No container runs as root. Images come from your registry and are signed. Every new namespace gets a default network policy.

You can enforce these with reviews and good intentions, or you can enforce them at the API server. Kyverno does the second. It describes itself as "a cloud native policy engine": policies are Kubernetes resources, written in YAML with CEL expressions, so you manage them like any other manifest, in Git, through GitOps.

Kyverno can:

  • validate requests and block, or just report, the ones that break a rule;
  • mutate resources, for example adding default labels or security settings;
  • generate resources, such as a NetworkPolicy for each new namespace;
  • delete resources that match a condition, on a schedule;
  • verify images, checking signatures and attestations before a Pod runs.

Kyverno's maturity

Kyverno was created by Nirmata and contributed to the CNCF in 2020. According to the CNCF project page, it was accepted on 10 November 2020, moved to incubating on 13 July 2022 and reached graduated on 16 March 2026. CNCF announced the graduation on 24 March 2026 at KubeCon + CloudNativeCon Europe, after a third-party security audit.

How Kyverno works

Kyverno runs in the cluster as a dynamic admission controller. The API server sends it validating and mutating webhook calls, Kyverno evaluates the matching policies, then allows, changes or rejects the request.

Behind that sit a few controllers:

  • the webhook controller keeps the webhook configuration in step with the installed policies, so the API server only sends matching requests;
  • the background controller handles generate rules and changes to existing resources;
  • the report controllers turn results into Policy Reports, so you can see which existing resources pass or fail, including those created before the policy;
  • the cert renewer keeps the webhook certificates fresh.

The Kyverno CLI applies and tests policies outside the cluster, which is how you catch problems in CI before anything reaches the API server.

The Kyverno 1.20 change: from ClusterPolicy to CEL policies

Older Kyverno policies used kind: ClusterPolicy with validate, mutate, generate and verifyImages rules. Kyverno moved to CEL-based types that map one to one:

Legacy rule Current type
validate ValidatingPolicy
mutate MutatingPolicy
generate GeneratingPolicy
verifyImages ImageValidatingPolicy
CleanupPolicy DeletingPolicy

The legacy types were deprecated from Kyverno 1.17, and 1.20 removed the legacy engine: existing ClusterPolicy objects show as not ready and are no longer enforced. The Helm chart blocks an upgrade while legacy policies exist, unless you explicitly acknowledge it. If you run an older Kyverno, migrate your policies first with the project's migration guide. Kyverno 1.20 supports Kubernetes v1.34 to v1.37.

A small Kyverno example

Here's a ValidatingPolicy that requires an owner label on every Deployment. It starts in Audit mode, so it reports instead of blocking:

apiVersion: policies.kyverno.io/v1
kind: ValidatingPolicy
metadata:
  name: require-owner-label
spec:
  validationActions:
    - Audit
  matchConstraints:
    resourceRules:
      - apiGroups: ["apps"]
        apiVersions: ["v1"]
        operations: ["CREATE", "UPDATE"]
        resources: ["deployments"]
  validations:
    - message: "Deployments must have an owner label."
      expression: "'owner' in object.metadata.?labels.orValue({})"

Apply it, create a Deployment without the label, and check the result:

kubectl apply -f require-owner-label.yaml
kubectl create deployment web --image=nginx
kubectl get policyreports -A

When the reports look clean, change Audit to Deny and the API server will reject Deployments without the label. Pro tip: always roll out a new policy in Audit first. Policy Reports show you what would break before anything does.

Kyverno vs OPA Gatekeeper and ValidatingAdmissionPolicy

Kyverno isn't the only way to enforce policy:

  • ValidatingAdmissionPolicy is built into Kubernetes and stable since v1.30. It runs CEL rules in the API server itself, with no webhook. It's a good fit for simple validation, but it only validates.
  • OPA Gatekeeper uses Open Policy Agent and its Rego language. It's flexible and works well if your organisation already uses OPA beyond Kubernetes.
  • Kyverno uses Kubernetes-style resources and CEL (the same expression language as ValidatingAdmissionPolicy) and adds mutation, generation, cleanup, image verification and reports in one tool.

A reasonable rule of thumb: start with ValidatingAdmissionPolicy for a handful of simple checks, and reach for Kyverno when you need more than validation or want reports across the cluster.

Kyverno and the KCA exam

The Kyverno Certified Associate (KCA) is an online, proctored, multiple-choice exam of 90 minutes. The Linux Foundation lists it at US$250, valid for two years, with one retake. Its domains are Writing Policies (32%), Fundamentals of Kyverno (18%), Installation, Configuration, and Upgrades (18%), Kyverno CLI (12%), Applying Policies (10%) and Policy Management (10%).

The KCA is also one of the exams for Golden Kubestronaut. Before you study, check which Kyverno version and policy types the current KCA curriculum covers, since the move to CEL policies is recent. The Linux Foundation's Mastering Kubernetes Security with Kyverno (LFS255) course is the official preparation.

How to get started with Kyverno

  1. Install it in a test cluster with Helm:

    helm repo add kyverno https://kyverno.github.io/kyverno/
    helm repo update
    helm install kyverno kyverno/kyverno -n kyverno --create-namespace
    
  2. Apply the example above in Audit mode and read the Policy Reports.

  3. Add the Kyverno CLI to CI so policies are tested before they reach a cluster.

  4. Read the policy types docs for ValidatingPolicy and MutatingPolicy, and skip tutorials that still use ClusterPolicy.

  5. Follow the project on our Kyverno page for releases and our posts about it.

FAQ

What is Kyverno used for? Enforcing rules on Kubernetes resources: blocking insecure or non-compliant workloads, adding defaults, creating resources such as network policies automatically, cleaning up, and verifying container images.

Is Kyverno better than OPA Gatekeeper? Neither is better in general. Kyverno uses Kubernetes-style YAML and CEL and covers mutation and generation in one tool; Gatekeeper uses Rego and suits teams that already use OPA elsewhere.

Is ClusterPolicy deprecated in Kyverno? Yes. It was deprecated in earlier releases and Kyverno 1.20 removed the legacy engine, so ClusterPolicy objects are no longer enforced. Use ValidatingPolicy and the other CEL-based types.

Is Kyverno a CNCF graduated project? Yes. It joined the CNCF in 2020 and graduated in March 2026.

Is the KCA exam hard? It's a 90-minute multiple-choice exam, so it tests understanding rather than speed at the terminal. Writing policies is a third of the exam, so practise writing and testing them yourself.

Install it in a kind cluster tonight, write one policy in Audit mode, and you'll understand Kyverno better than any diagram can show you.

Sources