K8S 使用calico 在多网卡主机上的问题
calico使用哪个网卡的ip,有它自己的发现策略机制,参见官方文档:https://docs.projectcalico.org/reference/node/configuration#ip-autodetection-methods这导致在多网卡(多ip)主机上,他的默认发现规则first-found可能并不是你想要的,导致的结果就是不通主机间pod ping不通。在主机上能ping通本机上
·
calico使用哪个网卡的ip,有它自己的发现策略机制,参见官方文档:
https://docs.projectcalico.org/reference/node/configuration#ip-autodetection-methods
这导致在多网卡(多ip)主机上,他的默认发现规则first-found可能并不是你想要的,导致的结果就是不通主机间pod ping不通。在主机上能ping通本机上的pod的ip。
可以进到calico pod中
kubectl get po -n kube-system |grep calico
使用如下命令,查看当前网络的状态
birdcl -s /var/run/calico/bird.ctl show protocols
如果有非Established的状态,可以从这里入手排查。
那么我们可以通过指定使用哪个网卡来规避这个问题
kubectl set env daemonset/calico-node -n kube-system IP_AUTODETECTION_METHOD=interface=eth0
参考:
https://docs.projectcalico.org/networking/ip-autodetection#change-the-autodetection-method
更多推荐
已为社区贡献15条内容
所有评论(0)