Skip to main content

4. Cleanup

You can remove jsPolicy from your cluster by uninstalling the Helm deployment and deleting all associated cluster-wide resources.

Delete Helm Release#

To uninstall jsPolicy, it is highly recommended to use Helm:

helm delete -n jspolicy jspolicy

After deleting the jsPolicy Helm release, you may also delete the corresponding namespace:

kubectl delete namespace jspolicy
Delete Webhook

If you accidentially deleted the namespace without deleting the jsPolicy Helm release beforehand, you will have to remove the webhook manually or requests to your cluster may fail due to the failing webhook:

kubectl delete validatingwebhookconfiguration jspolicy
Delete CRDs

Some CRDs may still be in place which may cause clusters to fail to respond to API requests due to the failing webhook. In such case you may need to delete the resources:

kubectl api-resources --api-group='policy.jspolicy.com' -o name | xargs kubectl delete crd
Data Loss

Deleting the jsPolicy CRDs will also remove all jsPolicy objects inside your cluster, i.e. all JsPolicy, JsPolicyBundle, and JsPolicyViolations objects.