root@ubuntu:~# kubectl logs -f calico-node-2l47s -n kube-system 2021-06-23 07:04:14.117 [INFO][10] startup/startup.go 390: Early log level set to info 2021-06-23 07:04:14.118 [INFO][10] startup/startup.go 406: Using NODENAME environment for node name centos7 2021-06-23 07:04:14.118 [INFO][10] startup/startup.go 418: Determined node name: centos7 2021-06-23 07:04:14.118 [INFO][10] startup/startup.go 103: Starting node centos7 with version v3.19.1 2021-06-23 07:04:14.120 [INFO][10] startup/startup.go 450: Checking datastore connection 2021-06-23 07:04:14.132 [INFO][10] startup/startup.go 474: Datastore connection verified 2021-06-23 07:04:14.132 [INFO][10] startup/startup.go 113: Datastore is ready 2021-06-23 07:04:14.149 [INFO][10] startup/startup.go 515: Initialize BGP data 2021-06-23 07:04:14.152 [WARNING][10] startup/startup.go 784: Unable to auto-detect an IPv4 address using interface regexes [enahisic2i0]: no valid host interfaces found 2021-06-23 07:04:14.152 [WARNING][10] startup/startup.go 537: Couldn't autodetect an IPv4 address. If auto-detecting, choose a different autodetection method. Otherwise provide an explicit address. 2021-06-23 07:04:14.152 [INFO][10] startup/startup.go 354: Clearing out-of-date IPv4 address from this node IP="" 2021-06-23 07:04:14.162 [WARNING][10] startup/startup.go 1347: Terminating Calico node failed to start
- name: IP_AUTODETECTION_METHOD value: "interface=enahisic2i0"
沒有這個網卡
[root@localhost ~]# ip a | grep enahisic2i0
[root@localhost ~]#
kubectl edit ds calico-node -n kube-system
- name: IP_AUTODETECTION_METHOD value: interface=en.*
root@ubuntu:~# kubectl get pods -n kube-system NAME READY STATUS RESTARTS AGE calico-kube-controllers-5978c5f6b5-tk6pg 1/1 Running 0 4d19h calico-node-gnp9x 0/1 Running 0 21s calico-node-jcvsf 1/1 Running 0 53s calico-node-pq756 0/1 Running 0 43s calico-node-qxk2j 1/1 Running 0 28h coredns-66bff467f8-hlbzk 1/1 Running 0 2d coredns-66bff467f8-zx85v 1/1 Running 0 2d
最好的方式
- name: IP_AUTODETECTION_METHOD value: "can-reach=10.10.16.254" #value: interface=en.*