tezos-k8s icon indicating copy to clipboard operation
tezos-k8s copied to clipboard

Cleanup script for minikube and pulumi

Open brandisimus opened this issue 3 years ago • 1 comments

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.

brandisimus avatar Mar 22 '21 19:03 brandisimus

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"

harryttd avatar Jul 22 '21 17:07 harryttd