在这里插入图片描述
错误:
今天莫名其妙发现calico-node无法启动,未就绪状态:
在这里插入图片描述

[root@k8s-master ~]# kubectl describe pod calico-node-v2dws -n kube-system
Name:                 calico-node-v2dws
Namespace:            kube-system
Priority:             2000001000
Priority Class Name:  system-node-critical
Service Account:      calico-node
Node:                 k8s-master/192.168.241.63
Start Time:           Fri, 22 Dec 2023 17:30:16 +0800
Labels:               controller-revision-hash=7bcb95cfd9
                      k8s-app=calico-node
                      pod-template-generation=1
Annotations:          <none>
Status:               Running
IP:                   192.168.241.63
IPs:
  IP:           192.168.241.63
Controlled By:  DaemonSet/calico-node
Init Containers:
  upgrade-ipam:
    Container ID:  containerd://cf1412745b1d14d497cb244311d653f81968848e6532579ef61e15c76fb19eff
    Image:         docker.io/calico/cni:v3.18.0
    Image ID:      sha256:727de170e4ce9d45d303d07c6147c78c21f1685cf6742a6bd4820343f09727d7
    Port:          <none>
    Host Port:     <none>
    Command:
      /opt/cni/bin/calico-ipam
      -upgrade
    State:          Terminated
      Reason:       Completed
      Exit Code:    0
      Started:      Fri, 22 Dec 2023 17:30:17 +0800
      Finished:     Fri, 22 Dec 2023 17:30:17 +0800
    Ready:          True
    Restart Count:  0
    Environment Variables from:
      kubernetes-services-endpoint  ConfigMap  Optional: true
    Environment:
      KUBERNETES_NODE_NAME:        (v1:spec.nodeName)
      CALICO_NETWORKING_BACKEND:  <set to the key 'calico_backend' of config map 'calico-config'>  Optional: false
    Mounts:
      /host/opt/cni/bin from cni-bin-dir (rw)
      /var/lib/cni/networks from host-local-net-dir (rw)
      /var/run/secrets/kubernetes.io/serviceaccount from kube-api-access-glq5g (ro)
  install-cni:
    Container ID:  containerd://036b834c626699364f685f3e518fefb36efb8641082f8dc902898b1fd6136b43
    Image:         docker.io/calico/cni:v3.18.0
    Image ID:      sha256:727de170e4ce9d45d303d07c6147c78c21f1685cf6742a6bd4820343f09727d7
    Port:          <none>
    Host Port:     <none>
    Command:
      /opt/cni/bin/install
    State:          Terminated
      Reason:       Completed
      Exit Code:    0
      Started:      Fri, 22 Dec 2023 17:30:17 +0800
      Finished:     Fri, 22 Dec 2023 17:30:19 +0800
    Ready:          True
    Restart Count:  0
    Environment Variables from:
      kubernetes-services-endpoint  ConfigMap  Optional: true
    Environment:
      CNI_CONF_NAME:         10-calico.conflist
      CNI_NETWORK_CONFIG:    <set to the key 'cni_network_config' of config map 'calico-config'>  Optional: false
      KUBERNETES_NODE_NAME:   (v1:spec.nodeName)
      CNI_MTU:               <set to the key 'veth_mtu' of config map 'calico-config'>  Optional: false
      SLEEP:                 false
    Mounts:
      /host/etc/cni/net.d from cni-net-dir (rw)
      /host/opt/cni/bin from cni-bin-dir (rw)
      /var/run/secrets/kubernetes.io/serviceaccount from kube-api-access-glq5g (ro)
  flexvol-driver:
    Container ID:   containerd://2d352e615f532423e0212956863f969c5fffb064c146c75c424c45514511f45e
    Image:          docker.io/calico/pod2daemon-flexvol:v3.18.0
    Image ID:       sha256:2a22066e9588d0da835a68d1cf39d735be555a3b99111866637edd2584711239
    Port:           <none>
    Host Port:      <none>
    State:          Terminated
      Reason:       Completed
      Exit Code:    0
      Started:      Fri, 22 Dec 2023 17:30:21 +0800
      Finished:     Fri, 22 Dec 2023 17:30:21 +0800
    Ready:          True
    Restart Count:  0
    Environment:    <none>
    Mounts:
      /host/driver from flexvol-driver-host (rw)
      /var/run/secrets/kubernetes.io/serviceaccount from kube-api-access-glq5g (ro)
Containers:
  calico-node:
    Container ID:   containerd://4b3838e7414eee8e62a95c598174ca3052761386858463d4f53039d326bd1866
    Image:          docker.io/calico/node:v3.18.0
    Image ID:       sha256:5a7c4970fbc29f122f97f65426add223d4da1253b63b6a02ab98ae0d27f4b3f5
    Port:           <none>
    Host Port:      <none>
    State:          Running
      Started:      Wed, 03 Jan 2024 17:11:51 +0800
    Last State:     Terminated
      Reason:       Completed
      Exit Code:    0
      Started:      Wed, 27 Dec 2023 11:10:55 +0800
      Finished:     Wed, 03 Jan 2024 17:11:39 +0800
    Ready:          False
    Restart Count:  2
    Requests:
      cpu:      250m
    Liveness:   exec [/bin/calico-node -felix-live -bird-live] delay=10s timeout=1s period=10s #success=1 #failure=6
    Readiness:  exec [/bin/calico-node -felix-ready -bird-ready] delay=0s timeout=1s period=10s #success=1 #failure=3
    Environment Variables from:
      kubernetes-services-endpoint  ConfigMap  Optional: true
    Environment:
      DATASTORE_TYPE:                     kubernetes
      WAIT_FOR_DATASTORE:                 true
      NODENAME:                            (v1:spec.nodeName)
      CALICO_NETWORKING_BACKEND:          <set to the key 'calico_backend' of config map 'calico-config'>  Optional: false
      CLUSTER_TYPE:                       k8s,bgp
      IP:                                 autodetect
      CALICO_IPV4POOL_IPIP:               Always
      CALICO_IPV4POOL_VXLAN:              Never
      FELIX_IPINIPMTU:                    <set to the key 'veth_mtu' of config map 'calico-config'>  Optional: false
      FELIX_VXLANMTU:                     <set to the key 'veth_mtu' of config map 'calico-config'>  Optional: false
      FELIX_WIREGUARDMTU:                 <set to the key 'veth_mtu' of config map 'calico-config'>  Optional: false
      CALICO_DISABLE_FILE_LOGGING:        true
      FELIX_DEFAULTENDPOINTTOHOSTACTION:  ACCEPT
      FELIX_IPV6SUPPORT:                  false
      FELIX_LOGSEVERITYSCREEN:            info
      FELIX_HEALTHENABLED:                true
    Mounts:
      /lib/modules from lib-modules (ro)
      /run/xtables.lock from xtables-lock (rw)
      /sys/fs/ from sysfs (rw)
      /var/lib/calico from var-lib-calico (rw)
      /var/log/calico/cni from cni-log-dir (ro)
      /var/run/calico from var-run-calico (rw)
      /var/run/nodeagent from policysync (rw)
      /var/run/secrets/kubernetes.io/serviceaccount from kube-api-access-glq5g (ro)
Conditions:
  Type              Status
  Initialized       True
  Ready             False
  ContainersReady   False
  PodScheduled      True
Volumes:
  lib-modules:
    Type:          HostPath (bare host directory volume)
    Path:          /lib/modules
    HostPathType:
  var-run-calico:
    Type:          HostPath (bare host directory volume)
    Path:          /var/run/calico
    HostPathType:
  var-lib-calico:
    Type:          HostPath (bare host directory volume)
    Path:          /var/lib/calico
    HostPathType:
  xtables-lock:
    Type:          HostPath (bare host directory volume)
    Path:          /run/xtables.lock
    HostPathType:  FileOrCreate
  sysfs:
    Type:          HostPath (bare host directory volume)
    Path:          /sys/fs/
    HostPathType:  DirectoryOrCreate
  cni-bin-dir:
    Type:          HostPath (bare host directory volume)
    Path:          /opt/cni/bin
    HostPathType:
  cni-net-dir:
    Type:          HostPath (bare host directory volume)
    Path:          /etc/cni/net.d
    HostPathType:
  cni-log-dir:
    Type:          HostPath (bare host directory volume)
    Path:          /var/log/calico/cni
    HostPathType:
  host-local-net-dir:
    Type:          HostPath (bare host directory volume)
    Path:          /var/lib/cni/networks
    HostPathType:
  policysync:
    Type:          HostPath (bare host directory volume)
    Path:          /var/run/nodeagent
    HostPathType:  DirectoryOrCreate
  flexvol-driver-host:
    Type:          HostPath (bare host directory volume)
    Path:          /usr/libexec/kubernetes/kubelet-plugins/volume/exec/nodeagent~uds
    HostPathType:  DirectoryOrCreate
  kube-api-access-glq5g:
    Type:                    Projected (a volume that contains injected data from multiple sources)
    TokenExpirationSeconds:  3607
    ConfigMapName:           kube-root-ca.crt
    ConfigMapOptional:       <nil>
    DownwardAPI:             true
QoS Class:                   Burstable
Node-Selectors:              kubernetes.io/os=linux
Tolerations:                 :NoSchedule op=Exists
                             :NoExecute op=Exists
                             CriticalAddonsOnly op=Exists
                             node.kubernetes.io/disk-pressure:NoSchedule op=Exists
                             node.kubernetes.io/memory-pressure:NoSchedule op=Exists
                             node.kubernetes.io/network-unavailable:NoSchedule op=Exists
                             node.kubernetes.io/not-ready:NoExecute op=Exists
                             node.kubernetes.io/pid-pressure:NoSchedule op=Exists
                             node.kubernetes.io/unreachable:NoExecute op=Exists
                             node.kubernetes.io/unschedulable:NoSchedule op=Exists
Events:
  Type     Reason     Age                    From     Message
  ----     ------     ----                   ----     -------
  Warning  Unhealthy  3m7s (x17307 over 8d)  kubelet  (combined from similar events): Readiness probe failed: 2024-01-04 08:36:13.469 [INFO][102428] confd/health.go 180: Number of node(s) with BGP peering established = 0
**calico/node is not ready: BIRD is not ready: BGP not established with 192.168.241.64,192.168.241.65**

在这里插入图片描述产生该报错的原因是nodes节点上出现了冲突的网卡br-*****,将以br-开头的网卡删除掉,并将Calico组件的Pod删除掉,就能恢复正常了
1、查看网卡

[root@k8s-master ~]# ip link |grep  br-
101: br-1f46bf182b3d: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP mode DEFAULT group default

2、删除网卡

[root@k8s-master ~]# ip link delete br-1f46bf182b3d

3、删除Calico组件的旧Pod

[root@k8s-master ~]# kubectl delete pod calico-node-v2dws -n kube-system
pod "calico-node-v2dws" deleted

Logo

K8S/Kubernetes社区为您提供最前沿的新闻资讯和知识内容

更多推荐