Skip to content

Instantly share code, notes, and snippets.

@ejancorp
Forked from carlosedp/gist:5040f4a1b2c97c1fa260a3409b5f14f9
Last active November 24, 2019 10:06
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 ejancorp/1ed44285cf6cd2b84df1e429fe4583be to your computer and use it in GitHub Desktop.
Save ejancorp/1ed44285cf6cd2b84df1e429fe4583be to your computer and use it in GitHub Desktop.
Reset Kubernetes cluster with Weave
# Drain and delete the nodes (for each node you have)
kubectl drain kubenode1 --delete-local-data --force --ignore-daemonsets
kubectl delete node kubenode1
# Reset the deployment
sudo kubeadm reset
# On each node
## Reset the nodes and weave
sudo curl -L git.io/weave -o /usr/local/bin/weave
sudo chmod a+x /usr/local/bin/weave
sudo kubeadm reset
sudo weave reset --force
## Clean weave binaries
sudo rm /opt/cni/bin/weave-*
## Flush iptables rules on all nodes and restart Docker
iptables -P INPUT ACCEPT
iptables -P FORWARD ACCEPT
iptables -P OUTPUT ACCEPT
iptables -t nat -F
iptables -t mangle -F
iptables -F
iptables -X
systemctl restart docker
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment