Last active
February 1, 2024 16:26
-
-
Save alexolinux/2c6b6ae5f6a50313b2f6ae43ad493a4b to your computer and use it in GitHub Desktop.
Clean Up kubeadm confs (Useful for reinstallation or adjustments)
This file contains hidden or 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
| #!/bin/bash | |
| # Remove/clean UP | |
| clear && echo "Seek and Remove!" | |
| sleep 3 | |
| kubeadm reset -f | |
| sudo rm -rf /etc/cni /etc/kubernetes /var/lib/dockershim /var/lib/etcd /var/lib/kubelet /var/run/kubernetes ~/.kube/* | |
| iptables -F && iptables -X | |
| iptables -t nat -F && iptables -t nat -X | |
| iptables -t raw -F && iptables -t raw -X | |
| iptables -t mangle -F && iptables -t mangle -X | |
| # Restart if docker is installed | |
| if command -v systemctl &> /dev/null && systemctl status docker &> /dev/null; then | |
| sudo systemctl restart docker | |
| fi |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Only for development environment.