Forked from carlosedp/gist:5040f4a1b2c97c1fa260a3409b5f14f9
Created
January 26, 2019 19:37
-
-
Save cxhercules/1bc9aa27a6cbda38b9da4177b2fc702e to your computer and use it in GitHub Desktop.
Reset Kubernetes cluster with Weave
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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