Skip to content

Commit

Permalink
hack(kubeadm): add cleanup kubeadm script
Browse files Browse the repository at this point in the history
  • Loading branch information
hsinhoyeh committed Oct 19, 2022
1 parent cee3fb8 commit e46a174
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions hack/kubeadm/9.cleanup_kubeadm.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/usr/bin/env bash


# run kubeadm reset to kick off reset process
kubeadm reset -f

# stop kubelet and docker
systemctl stop kubelet
systemctl stop docker

# remove orphant files
rm -rf /var/lib/cni/
rm -rf /var/lib/kubelet/*
rm -rf /etc/cni/

# stop network inferface
ifconfig cni0 down
ifconfig flannel.1 down
ifconfig docker0 down

# remove network interface
ip link delete cni0
ip link delete flannel.1

# restart docker
systemctl restart kubelet
systemctl restart docker

0 comments on commit e46a174

Please sign in to comment.