Skip to content

Instantly share code, notes, and snippets.

@alexolinux
Last active February 1, 2024 16:26
Show Gist options
  • Select an option

  • Save alexolinux/2c6b6ae5f6a50313b2f6ae43ad493a4b to your computer and use it in GitHub Desktop.

Select an option

Save alexolinux/2c6b6ae5f6a50313b2f6ae43ad493a4b to your computer and use it in GitHub Desktop.
Clean Up kubeadm confs (Useful for reinstallation or adjustments)
#!/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
@alexolinux
Copy link
Author

Only for development environment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment