k8s/003-cert-manager/uninstall.sh

23 lines
743 B
Bash
Raw Normal View History

2022-07-02 18:47:08 +00:00
#!/bin/bash
CHART_VERSION=1.9.1
2022-07-02 18:47:08 +00:00
kubectl delete -f issuers.yaml
for i in $(kubectl get Issuers -n cert-manager | grep -v NAME | cut -d' ' -f1); do
kubectl delete Issuers -n cert-manager $i
done
for i in $(kubectl get ClusterIssuers | grep -v NAME | cut -d' ' -f1); do
kubectl delete ClusterIssuers $i
done
for i in $(kubectl get Certificates -n cert-manager | grep -v NAME | cut -d' ' -f1); do
kubectl delete Certificates -n cert-manager $i
done
helm -n cert-manager delete namecheap-webhook
helm -n cert-manager delete letsencrypt-namecheap-issuer
helm -n cert-manager delete cert-manager
kubectl delete -n ${NAMESPACE} -f external-secrets.yaml
kubectl delete -n ${NAMESPACE} -f serviceaccounttoken.yaml
kubectl delete ns cert-manager