KOP Recipes - Kyverno - Rafay Product Documentation

Overview

Overview

Kyverno is a policy engine designed specifically for Kubernetes. Kyverno allows platform teams to manage environment specific configurations independently of workload configurations and enforce configuration best practices for their clusters. Kyverno can be used to scan existing workloads for best practices, or can be used to enforce best practices by blocking or mutating API requests.

Kyverno runs as a dynamic admission controller in a Kubernetes cluster. Kyverno receives validating and mutating admission webhook HTTP callbacks from the kube-apiserver and applies matching policies to return results that enforce admission policies or reject requests. Kyverno policies can match resources using the resource kind, name, and label selectors.


What Will You Do

In this exercise,

Important

This tutorial describes the steps to create and use a Kyverno based blueprint using the Web Console. The entire workflow can also be fully automated and embedded into an automation pipeline.


Assumptions


Step 1: Create Kyverno add-on using System Catalog


Step 2: Create Blueprint

Now, we are ready to assemble a custom cluster blueprint.


Step 3: Apply Blueprint

Now, we are ready to apply this blueprint to a cluster.

This will start the deployment of the add-on configured in the blueprint to the targeted cluster. The blueprint sync process can take a few minutes. Once complete, the cluster will display the current cluster blueprint details and whether the sync was successful or not.


Step 4: Verify Deployment

Users can optionally verify whether the correct resources have been created on the cluster.

First, we will verify if the kyverno namespace has been created

kubectl get ns kyverno

Next, we will verify if the pods are healthy in the "kyverno" namespace

kubectl get po -n kyverno

Recap

Congratulations! You have successfully created a custom cluster blueprint with the "kyverno" add-on and applied to a cluster.