Flannel

flannel是k8s最常用的网络插件.

https://github.com/coreos/flannel

部署:

1
$ kubectl apply -f https://raw.githubusercontent.com/coreos/flannel/master/Documentation/kube-flannel.yml

重新部署网络插件:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
$ kubectl delete -f X.yml  

// 第二步,在node节点清理flannel网络留下的文件
ifconfig cni0 down
ip link delete cni0
ifconfig flannel.1 down
ip link delete flannel.1
rm -rf /var/lib/cni/
rm -f /etc/cni/net.d/*

// 重启kubelet
$ sudo systemctl restart kubelet