Last active
August 1, 2024 17:53
-
-
Save davidcorbin/52221aab05516eb6f2414e9901f505d1 to your computer and use it in GitHub Desktop.
Remove Rancher from Cluster - Force Delete CRDs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Manually remove finalizers | |
kubectl edit -n cattle-system secret tls-rancher | |
kubectl patch secret tls-rancher -p '{"metadata":{"finalizers":[]}}' --type='merge' -n cattle-system | |
kubectl patch namespace cattle-system -p '{"metadata":{"finalizers":[]}}' --type='merge' -n cattle-system | |
kubectl delete namespace cattle-system --grace-period=0 --force | |
kubectl patch namespace cattle-global-data -p '{"metadata":{"finalizers":[]}}' --type='merge' -n cattle-system | |
kubectl delete namespace cattle-global-data --grace-period=0 --force | |
kubectl patch namespace local -p '{"metadata":{"finalizers":[]}}' --type='merge' -n cattle-system | |
kubectl get customresourcedefinitions |grep cattle.io |awk '{print $1}' |xargs kubectl patch -p '{"metadata":{"finalizers":[]}}' --type=merge crd | |
# Delete CRDs | |
kubectl get customresourcedefinitions |grep cattle.io |awk '{print $1}' |xargs kubectl delete customresourcedefinitions --force --grace-period=0 | |
kubectl delete namespace local --grace-period=0 --force |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
awasome thanks.