How to install Kyverno in a k8s cluster?

Suresh Kumar - Apr 26 '22 - - Dev Community

In the k8s policy management series, We're going to look at how to install Kyverno dynamic admission controller and its CRDs can installed in k8s cluster using helm or yaml manifests.

Install using helm

helm repo add kyverno https://kyverno.github.io/kyverno/
helm repo update

# Install kyverno controller
helm install kyverno kyverno/kyverno --namespace kyverno --create-namespace

# Install kyverno policies
helm install kyverno-policies kyverno/kyverno-policies --namespace kyverno

Enter fullscreen mode Exit fullscreen mode

Install using yaml

kubectl create -f https://raw.githubusercontent.com/kyverno/kyverno/main/config/install.yaml

Enter fullscreen mode Exit fullscreen mode

To check the Kyverno controller status, run the command:

kubectl get pods -n <namespace>
Enter fullscreen mode Exit fullscreen mode

If the Kyverno controller is not running, you can check its status and logs for errors:

kubectl describe pod <kyverno-pod-name> -n <namespace>
kubectl logs -l app.kubernetes.io/name=kyverno -n <namespace>

Enter fullscreen mode Exit fullscreen mode
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .