2021-12-08 16:29:53 +00:00
|
|
|
#!/bin/bash
|
|
|
|
set -x
|
|
|
|
|
|
|
|
# Allow EFS and EBS Argo apps to be deleted without removing things like storageClasses etc.
|
2021-12-15 22:19:15 +00:00
|
|
|
# all to be replaced by kubezero-storage
|
2021-12-08 16:29:53 +00:00
|
|
|
kubectl patch application aws-ebs-csi-driver -n argocd --type=json -p='[{"op": "remove", "path": "/metadata/finalizers"}]'
|
|
|
|
kubectl patch application aws-efs-csi-driver -n argocd --type=json -p='[{"op": "remove", "path": "/metadata/finalizers"}]'
|
|
|
|
|
|
|
|
# Delete EBS and EFS Deployments and Daemonsets as we cannot change the lables while moving them to storage.
|
|
|
|
# This will NOT affect provisioned volumes
|
|
|
|
kubectl delete deployment ebs-csi-controller -n kube-system
|
|
|
|
kubectl delete daemonSet ebs-csi-node -n kube-system
|
2021-12-15 22:19:15 +00:00
|
|
|
|
|
|
|
# Snapshot controller was removed from EBS chart
|
2021-12-08 16:29:53 +00:00
|
|
|
kubectl delete statefulset ebs-snapshot-controller -n kube-system
|
|
|
|
|
|
|
|
kubectl delete deployment efs-csi-controller -n kube-system
|
|
|
|
kubectl delete daemonSet efs-csi-node -n kube-system
|
2021-12-09 13:03:34 +00:00
|
|
|
|
|
|
|
# Remove calico Servicemonitor in case still around
|
2021-12-19 22:18:01 +00:00
|
|
|
kubectl delete servicemonitor calico-node -n kube-system
|
2021-12-09 18:03:55 +00:00
|
|
|
|
|
|
|
# Upgrade Prometheus stack, requires state metrics to be removed first
|
|
|
|
kubectl delete deployment metrics-kube-state-metrics -n monitoring
|
|
|
|
kubectl delete deployment metrics-prometheus-adapter -n monitoring
|