Kyverno detection on clusters that already run Kyverno

Kyverno is a cluster-wide component with fixed custom resource definition, cluster role, and webhook names, so two instances in one cluster conflict.

Kyverno is a cluster-wide component with fixed custom resource definition, cluster role, and webhook names. Two instances in one cluster take ownership of the objects that the other instance owns, and one instance then fails to start. The cluster-vars phase therefore looks for a running Kyverno admission controller that carries the app.kubernetes.io/part-of=kyverno label, and it acts on what it finds:

  • No other instance, or only the instance that the artifact provides – the installer changes nothing, and the artifact installs or keeps its own instance.
  • Exactly one other instance – the installer sets kyverno_suspend to true and kyverno_namespace to the namespace of that instance, so the artifact does not reconcile its own release and the existing instance enforces the Cloudera Cloud Factory policies.
  • Both the kyverno namespace and another namespace, several other instances, an admission controller that does not run as kyverno-admission-controller, or a failed lookup – the installer changes nothing and prints a warning. Resolve the cluster state, or set the Kyverno variables yourself.

To decide the outcome yourself, set CLUSTER_VAR_kyverno_suspend or CLUSTER_VAR_kyverno_namespace in bootstrap.env. A suspended release does not uninstall anything that is already running, and the installer still creates the empty kyverno namespace and its image pull Secret.