Uninstall the Components and Clean Up the Cluster
5 min
use this procedure to return the cluster to a clean state, for example before a fresh installation before uninstalling, check whether the release owns any persistent data in the reference environment there were no persistentvolumeclaims or externally managed secrets, so uninstall and reinstall were non destructive this must be re verified in every environment step 1 — record the current configuration helm list a helm get values kron aapm agent n ns agent helm get values aapm service n kron pam aapm helm get values kron aapm sidecar n ns sidecar kubectl get all,pvc,secret,cm n ns agent kubectl get all,pvc,secret,cm n kron pam aapm kubectl get all,pvc,secret,cm n ns sidecar step 2 — uninstall the releases (injector first) uninstall in reverse order of installation, so that dependent components are removed before the agent they rely on helm uninstall kron aapm sidecar n ns sidecar helm uninstall aapm service n kron pam aapm helm uninstall kron aapm agent n ns agent step 3 — remove leftover cluster scoped resources helm uninstall normally removes these, but they must be verified a leftover webhook configuration blocks pod creation in labeled namespaces kubectl get mutatingwebhookconfiguration | grep i aapm kubectl get clusterrole,clusterrolebinding | grep i aapm delete any remaining objects explicitly kubectl delete mutatingwebhookconfiguration \<name> kubectl delete clusterrole \<name> kubectl delete clusterrolebinding \<name> step 4 — remove namespaces, labels, and secrets kubectl label namespace \<target namespace> aapm injection kubectl delete secret aapm client secret n \<target namespace> kubectl delete namespace ns agent kron pam aapm ns sidecar step 5 stop background port forwards pkill f "kubectl port forward" || true ss tlnp | grep e ' 8443| 8080' step 6 — verify the cluster is clean helm list a kubectl get ns kubectl get mutatingwebhookconfiguration success criteria helm list a returns empty, the three namespaces are gone, and no aapm related mutating webhook configuration remains uninstalling the agent doesn't remove its registration from the kron pam console remove or re use the agent entry on the kron pam side as well; otherwise a reinstallation using the same agentname may conflict