flannel是k8s的pod網(wǎng)絡(luò)之一,cni0是配置flannel時會出現(xiàn)的典型網(wǎng)橋
Cni0:網(wǎng)橋設(shè)備,每創(chuàng)建一個 Pod 都會創(chuàng)建一對 Veth Pair。其中一端是 Pod 中的 eth0,另一端是 cni0 網(wǎng)橋中的端口(網(wǎng)卡)
進入一個pod
kubectl exec -it pod-name /bin/bash
有些教程會提到使用ip a等命令行看,但是對于k8s種的pod,大多不支持ip和ifconfig命令,可以通過容器內(nèi)部的文件來查看
cat /sys/class/net/eth0/iflink

在pod外(實體機)
ip link

所以我們剛才查看的pod的虛擬網(wǎng)卡是vethe533b9d4