![calico/node 未准备好:BIRD 未准备好:查询 BIRD 时出错:无法连接到 BIRDv4 套接字](https://linux22.com/image/230497/calico%2Fnode%20%E6%9C%AA%E5%87%86%E5%A4%87%E5%A5%BD%EF%BC%9ABIRD%20%E6%9C%AA%E5%87%86%E5%A4%87%E5%A5%BD%EF%BC%9A%E6%9F%A5%E8%AF%A2%20BIRD%20%E6%97%B6%E5%87%BA%E9%94%99%EF%BC%9A%E6%97%A0%E6%B3%95%E8%BF%9E%E6%8E%A5%E5%88%B0%20BIRDv4%20%E5%A5%97%E6%8E%A5%E5%AD%97.png)
主节点上的 calico pod 由于“无法连接到 BIRDv4 套接字”而处于 CrashLoopBackOff 状态
lab@master:~$ kubectl -nkube-system get po -o wide
NAME READY STATUS RESTARTS AGE IP NODE NOMINATED NODE READINESS GATES
calico-kube-controllers-74d5f9d7bb-k44d2 1/1 Running 19 (14m ago) 22d 10.10.219.106 master <none> <none>
calico-node-bfqsb 1/1 Running 2 (5h36m ago) 5h47m 192.168.56.111 worker01 <none> <none>
calico-node-trc9k 0/1 CrashLoopBackOff 6 (117s ago) 8m35s 192.168.56.110 master <none> <none>
coredns-5dd5756b68-4xvp6 1/1 Running 17 (14m ago) 22d 10.10.219.107 master <none> <none>
...
要走的路这是: https://github.com/projectcalico/calico/issues/2834
然而,文档中没有具体说明在哪里(在哪个文件中)设置/添加这些选项之一。有人知道吗?
答案1
原因:网卡太多,calico选错了。
为了帮助 Calico 选择所需的 NIC/IP 地址(将用于在节点之间路由),请在 calico-node DAEMONSET 清单中添加 IP 自动检测。
不知怎的,你应该明白这一点配置文档:
去做:
1. Backup current daemonset/calico-node
kubectl -nkube-system get daemonset calico-node -o yaml > calico-node.DAEMONSET.orig
2. Add IP autodetection in calico-node DAEMONSET manifest:
Note: I have choosen IP_AUTODETECTION_METHOD=can-reach=192.168.56.110 because it works the best for my case. U might want to try other options: https://docs.tigera.io/archive/v3.8/reference/node/configuration#ip-setting
kubectl -nkube-system edit daemonset/calico-node
Add it in this block:
- name: CLUSTER_TYPE
value: k8s,bgp
- name: IP
value: autodetect
- name: CALICO_IPV4POOL_IPIP
value: Always
- name: CALICO_IPV4POOL_VXLAN
value: Never
- name: CALICO_IPV6POOL_VXLAN
value: Never
- name: IP_AUTODETECTION_METHOD <--- add this
value: can-reach=192.168.56.110 <--- add this
- name: FELIX_IPINIPMTU
3. calico-node pods will be restarted with new config automatically.
kubectl -nkube-system get po -l k8s-app=calico-node -o wide
NAME READY STATUS RESTARTS AGE IP NODE NOMINATED NODE READINESS GATES
calico-node-dj2cl 1/1 Running 0 32m 192.168.56.110 master <none> <none>
calico-node-lq4h5 1/1 Running 0 32m 192.168.56.111 worker01 <none> <none>