Created
January 10, 2020 20:18
-
-
Save abraaojs/8c4a0927118033f1f29a3aabcd44ae2a to your computer and use it in GitHub Desktop.
docker iptables cleanup rancher
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
docker rm -f $(sudo docker ps -aq); | |
docker volume rm $(sudo docker volume ls -q); | |
rm -rf /etc/ceph \ | |
/etc/cni \ | |
/etc/kubernetes \ | |
/opt/cni \ | |
/opt/rke \ | |
/run/secrets/kubernetes.io \ | |
/run/calico \ | |
/run/flannel \ | |
/var/lib/calico \ | |
/var/lib/etcd \ | |
/var/lib/cni \ | |
/var/lib/kubelet \ | |
/var/lib/rancher/rke/log \ | |
/var/log/containers \ | |
/var/log/pods \ | |
/var/run/calico | |
for mount in $(mount | grep tmpfs | grep '/var/lib/kubelet' | awk '{ print $3 }') /var/lib/kubelet /var/lib/rancher; do umount $mount; done | |
rm -f /var/lib/containerd/io.containerd.metadata.v1.bolt/meta.db | |
sudo systemctl restart containerd | |
sudo systemctl restart docker | |
IPTABLES="/sbin/iptables" | |
cat /proc/net/ip_tables_names | while read table; do | |
$IPTABLES -t $table -L -n | while read c chain rest; do | |
if test "X$c" = "XChain" ; then | |
$IPTABLES -t $table -F $chain | |
fi | |
done | |
$IPTABLES -t $table -X | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment