kubernetes - 为什么calico在Kubernetes中缺少某些节点对等地址?

标签 kubernetes

我正在使用kubernetes v1.18并使用calico作为我的CNI插件,这是calico pod状态(删除不相关的pod):

[root@localhost ~]# kubectl get pods --all-namespaces -o wide
NAME                                            READY   STATUS    RESTARTS   AGE     IP              NODE                    NOMINATED NODE   READINESS GATES
calico-kube-controllers-75d555c48-lt4jr         1/1     Running   0          2d12h   10.11.102.134   localhost.localdomain   <none>           <none>
calico-node-6rj58                               1/1     Running   0          37h     192.168.31.30   k8sslave1               <none>           <none>
calico-node-czhww                               1/1     Running   0          2d12h   192.168.31.29   localhost.localdomain   <none>           <none>
calico-node-vwr5w                               1/1     Running   0          2d12h   192.168.31.31   k8sslave2               <none>           <none>
calicoctl                                       1/1     Running   0          93m     192.168.31.31   k8sslave2               <none>           <none>
然后在我的主主机节点中安装calicoctl:
curl -O -L  https://github.com/projectcalico/calicoctl/releases/download/v3.15.1/calicoctl
chmod +x calicoctl
mv calicoctl /usr/local
并获取印花布节点状态。
[root@localhost ~]# calicoctl node status
Calico process is running.

IPv4 BGP status
+---------------+-------------------+-------+----------+-------------+
| PEER ADDRESS  |     PEER TYPE     | STATE |  SINCE   |    INFO     |
+---------------+-------------------+-------+----------+-------------+
| 192.168.31.31 | node-to-node mesh | up    | 02:56:08 | Established |
| 192.168.31.30 | node-to-node mesh | up    | 02:56:09 | Established |
+---------------+-------------------+-------+----------+-------------+

IPv6 BGP status
No IPv6 peers found.
问题是:为什么找不到主192.168.31.29印花布节点?所有 pod 运行正常,我不知道如何找到原因。

最佳答案

The question is: why the master 192.168.31.29 calico nodes are not found?


听起来Calico无法为主服务器检索NODENAME。我看到它在您的命令输出中定义为localhost.localdomain
如果看到docs,则Calico需要能够确定NODENAME以添加calico / node资源并将其视为“网格”的一部分。

The calico/node must know the name of the node on which it is running. The node name is used to retrieve the Node resource configured for this node if it exists, or to create a new node resource representing the node if it does not. It is also used to associate the node with per-node BGP configuration, felix configuration, and endpoints.


另一个问题是,您是否打算在Kubernetes主服务器上运行工作负载?如果您不这样做,那么现在设置就可以了。如果这样做,那么是的,您必须确保Calico(覆盖图)可以正常工作,以便您的工作负载具有网络连接性。

关于kubernetes - 为什么calico在Kubernetes中缺少某些节点对等地址?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62857235/

相关文章:

git - 首次访问后 FluxCD 失败

ssl - 多个 SSL 证书 kubernetes

Kubernetes 入口错误 : The server encountered a temporary error and could not complete your request

kubernetes - 无法删除处于挂起状态的 Pod?

kubernetes - ManageIQ 未显示 Kubernetes 容器提供程序的信息,并且缺少集群读取器 ClusterRole

kubernetes - 使用用户名和密码访问Kubernetes API

cassandra - 失败后恢复数据,缓存架构版本不匹配

docker - Marathon vs Kubernetes vs Docker Swarm on DC/OS with Docker 容器

Kubernetes 持久卷 : MountPath directory created but empty

amazon-web-services - 如何自动缩放节点kubernetes