15

First I start Kubernetes using Flannel with 10.244.0.0.

Then I reset all and restart with 10.84.0.0.

However, the interface flannel.1 still is 10.244.1.0

That's how I clean up:

kubeadm reset
systemctl stop kubelet
systemctl stop docker
rm -rf /var/lib/cni/
rm -rf /var/lib/kubelet/*
rm -rf /run/flannel
rm -rf /etc/cni/
ifconfig cni0 down
brctl delbr cni0
ifconfig flannel.1 down
systemctl start docker

Am I missing something in the reset?

char
  • 2,063
  • 3
  • 15
  • 26
xren
  • 1,381
  • 5
  • 14
  • 29

2 Answers2

35

Because your ip link have the old record

look by

ip link you can see the record, and if you want to clean the record of old flannel and cni

please try

ip link delete cni0 ip link delete flannel.1

sam
  • 427
  • 4
  • 4
  • 2
    Please add a little more context around this answer. Why does this fix the problem? What did the original poster do wrong? Your answer has been flagged for deletion, adding more could prevent that from happening. – Graham Sep 27 '17 at 04:59
0

In the original commands:

brctl delbr cni0
# deletes the cni0 interface

But the ifconfig flannel.1 down did not remove the interface. Thus:

ip link delete flannel.1
# deletes the flannel.1 interface
# also, 'ip link delete cni0' was unnecessary since the brctl command deleted the link
Vaibhav Vishal
  • 6,576
  • 7
  • 27
  • 48