Login to the Master Node:
#####################
sudo kubeadm reset
sudo systemctl stop docker && sudo systemctl stop kubelet
sudo rm -rf /etc/kubernetes/
sudo rm -rf .kube/
sudo rm -rf /var/lib/kubelet/
sudo rm -rf /var/lib/cni/
sudo rm -rf /etc/cni/
sudo rm -rf /var/lib/etcd/
ifconfig cni0 down
ifconfig flannel.1 down
ifconfig docker0 down
sudo ip link delete cni0
sudo ip link delete flannel.1
kubeadm reset
does not delete any of the iptables rules it originally created. In other words, if you try to bootstrap your cluster with a different pod networking CIDR range or different networking options, you might run into trouble.
Please note if you are using a firewall configuration tool like ufw
, which uses iptables as system-of-record, the commands below might render your system inaccessible.
Because of this, we recommend that you flush all iptables rules:
iptables -F && iptables -t nat -F && iptables -t mangle -F && iptables -X
after you run kubeadm reset
and before you re-bootstrap the node (kubeadm init
) with new parameters.
This ensures that you really have a blank slate, and potentially saves you a lot of nasty network debugging.
sudo systemctl start docker && sudo systemctl start kubelet
sudo kubeadm init --pod-network-cidr=10.244.0.0/16 --control-plane-endpoint=<Specify a stable IP address or DNS name for the control plane >
#
kubectl apply -f https://raw.githubusercontent.com/coreos/flannel/2140ac876ef134e0ed5af15c65e414cf26827915/Documentation/kube-flannel.yml
Comments