Skip to content

Instantly share code, notes, and snippets.

@vitalbh
Created February 20, 2020 13:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vitalbh/4645a22244bf2fe3dfeb921f5a6e6e4f to your computer and use it in GitHub Desktop.
Save vitalbh/4645a22244bf2fe3dfeb921f5a6e6e4f to your computer and use it in GitHub Desktop.
#!/bin/bash
NODES=$(kubectl get nodes -o template --template='{{range.items}}{{range.status.addresses}}{{if eq .type "InternalIP"}}{{.address}}{{end}}{{end}} {{end}}')
echo Starting NODES cleanup ...
for node in $NODES
do
#echo $node
ssh -t -o ConnectTimeout=10 -o StrictHostKeyChecking=no admin@$node "sudo rm /var/lib/weave/weave-netdata.db"
done
echo Starting WEAVE PODS cleanup ...
for weave_pod in $(kubectl get pods -n kube-system | awk '{print $1}' | grep weave)
do
kubectl delete pod -n kube-system $weave_pod;
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment