tezos-k8s
tezos-k8s copied to clipboard
Cleanup script for minikube and pulumi
Minikube and Pulumi allegedly leave artefacts, volumes, states and even running nodes behind after deletion. The cleanup script will make sure all resources are tidied up after decommission.
I've been using this script. It naively assumes you won't have a KUBECONFIG for a minikube cluster:
# !/bin/bash
eval $(minikube docker-env)
[ -n "$KUBECONFIG" ] && echo "Only run this script for minikube. Exiting" && exit 0
echo "Current namespaces:"
kubectl get namespaces
echo
echo "kubectl delete namespaces --wait $@"
kubectl delete namespaces --wait "$@"
echo
echo "Checking if volumes still exist in minikube..."
#
# sleep 10
echo
VAR='for line in /tmp/hostpath-provisioner/*/;'
VAR="$VAR do echo \$line; echo \$line | xargs sudo ls; done; exit"
minikube ssh "$VAR"
VAR='sudo rm -rf /tmp/hostpath-provisioner/*;'
minikube ssh "$VAR"