Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/vim/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Kubernetes 库伯内特斯不能清理法兰绒_Kubernetes_Flannel - Fatal编程技术网

Kubernetes 库伯内特斯不能清理法兰绒

Kubernetes 库伯内特斯不能清理法兰绒,kubernetes,flannel,Kubernetes,Flannel,首先,我使用法兰绒10.244.0.0启动Kubernetes 然后我重置所有并使用10.84.0.0重新启动 但是,界面flannel.1仍然是10.244.1.0 我就是这样清理的: 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

首先,我使用法兰绒
10.244.0.0
启动Kubernetes

然后我重置所有并使用
10.84.0.0
重新启动

但是,界面
flannel.1
仍然是
10.244.1.0

我就是这样清理的:

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

我在重置中遗漏了什么吗

因为您的ip链接有旧记录

旁听

ip链路
你可以看到记录,如果你想清理旧法兰绒和cni的记录

请试一试

ip链路删除cni0
ip链接删除法兰绒。1

在原始命令中:

brctl delbr cni0
# deletes the cni0 interface
但是
ifconfig flannel.1 down
没有删除接口。因此:

ip link delete flannel.1
# deletes the flannel.1 interface
# also, 'ip link delete cni0' was unnecessary since the brctl command deleted the link

请围绕这个答案添加更多的上下文。为什么这能解决问题?原来的海报做错了什么?您的答案已被标记为删除,添加更多可能会阻止这种情况发生。