namespace/kube-flannel created serviceaccount/flannel created clusterrole.rbac.authorization.k8s.io/flannel created clusterrolebinding.rbac.authorization.k8s.io/flannel created configmap/kube-flannel-cfg created daemonset.apps/kube-flannel-ds created
[root@node2 ~]# brctl show bridge name bridge id STP enabled interfaces cni0 8000.12db4b6540b9 no veth11915e9e veth13da8459 veth68dfe2f4 vethb7e0fbb0 vethd8786cd9 vethe387ff6d vethe8dfec1a docker0 8000.0242684f69de no
根据是否为本机网段判断是否要走flannel.1
执行下面的命令我们可以看到 这是一个vxlan设备
1 2 3 4 5
[root@node1 node1]# ip -d link show flannel.1 10: flannel.1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1450 qdisc noqueue state UNKNOWN mode DEFAULT group default link/ether 56:bc:93:2b:1a:4b brd ff:ff:ff:ff:ff:ff promiscuity 0 vxlan id 1 local 192.168.31.170 dev enp0s3 srcport 0 0 dstport 8472 nolearning ageing 300 noudpcsum noudp6zerocsumtx noudp6zerocsumrx addrgenmode eui64 numtxqueues 1 numrxqueues 1 gso_max_size 65536 gso_max_segs 65535
[root@node2 ~]# ip route default via 192.168.31.1 dev enp0s3 proto static metric 100 10.233.64.0/24 via 192.168.31.170 dev enp0s3 10.233.65.0/24 via 192.168.31.172 dev enp0s3 10.233.66.0/24 dev cni0 proto kernel scope link src 10.233.66.1 172.17.0.0/16 dev docker0 proto kernel scope link src 172.17.0.1 192.168.31.0/24 dev enp0s3 proto kernel scope link src 192.168.31.171 metric 100