kubernetes cni 网络插件调试
最近搭建k8s集群的时候使用的网络插件是 bridge + host-local
关于cni插件
安装kubelet的时候会有一个kubernetes-cni-version-0.x86_64.rpm的依赖文件,安装了之后会在/opt/cni/bin下面会有各种网络插件
# rpm -qpl kubernetes-cni-0.7.5-0.x86_64.rpm
warning: kubernetes-cni-0.7.5-0.x86_64.rpm: Header V4 RSA/SHA512 Signature, key ID 3e1ba8d5: NOKEY
/opt/cni
/opt/cni/bin
/opt/cni/bin/bridge
/opt/cni/bin/dhcp
/opt/cni/bin/flannel
/opt/cni/bin/host-device
/opt/cni/bin/host-local
/opt/cni/bin/ipvlan
/opt/cni/bin/loopback
/opt/cni/bin/macvlan
/opt/cni/bin/portmap
/opt/cni/bin/ptp
/opt/cni/bin/sample
/opt/cni/bin/tuning
/opt/cni/bin/vlan
所有的cni插件在 spec-v0.3.1之前只实现两个接口 add, del。在spec-v0.4.0之后会在del之前执行check,所以多了一个check接口。
版本差异:Container Network Interface Specification

本文详细介绍了如何调试Kubernetes的CNI网络插件,包括查看安装的kubernetes-cni版本、理解CNI插件的不同版本接口、检查配置文件使用的CNI版本以及如何进行实际的调试操作。通过源码分析和执行测试脚本,帮助读者深入理解CNI的工作原理。
最低0.47元/天 解锁文章
1368

被折叠的 条评论
为什么被折叠?



