You can manage Kubewarden Helm charts, like other Helm charts, with Rancher Fleet. Rancher Fleet uses Kubernetes CRDs to define a GitOps approach to managing Kubernetes clusters. It does this by defining Fleet Bundles.
The Kubewarden charts are standard charts,
they have dependencies (such as
and depend transitively on each other
See the Quickstart docs) for more information.
Using Rancher Fleet, you can code the chart dependencies using
dependsOn in the
When removing the GitRepo, all 3 Kubewarden charts get removed at once.
This means the
kubewarden-crds chart gets incorrectly removed before the others.
Kubewarden uses a pre-delete helm hook job in
kubewarden-controller chart that deletes the default policy-server.
This pre-delete hook is necessary to vacate the webhooks of the policies before deleting the PolicyServer.
This is true for any Policy Engine: if not, the cluster may have webhooks for policies that don't exist anymore
hence rejecting everything and leaving the cluster in a failed state.
Removing the GitRepo, and therefore the
at the same time as the
kubewarden-controller chart makes the pre-delete hook job fail.
This means the removal is incomplete, potentially leaving the cluster in a failed state.
Uninstalling CRDs automatically isn't normally supported by any tooling, and Rancher Fleet is no exception.
To perform a correct removal,
make sure to first remove the Bundle for
kubewarden-defaults from the cluster.
Do this by committing those changes to the repository holding
the Fleet configuration and then waiting until it's applied.
kubewarden-controller in the same way,
and lastly, remove
Another option is to add 2 GitRepos, one for the CRDs only, and another for the rest of the Kubewarden charts. This lets you remove the Kubewarden charts first and the Kubewarden CRDs last.
For an example of Fleet bundle definitions see github.com/kubewarden/fleet-example.