calico/node 未准备好:BIRD 未准备好:查询 BIRD 时出错:无法连接到 BIRDv4 套接字

calico/node 未准备好:BIRD 未准备好:查询 BIRD 时出错:无法连接到 BIRDv4 套接字

主节点上的 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>

相关内容