首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >使用calico在kubernetes中丢失路由

使用calico在kubernetes中丢失路由
EN

Stack Overflow用户
提问于 2021-01-26 16:14:07
回答 1查看 167关注 0票数 0

我正在用calico在centos8上安装k8s,一切看起来都很好,但我不能在pods之间相互ping。

我使用k8s作为calico的数据存储区,部署文件在calico.yaml

我不知道为什么有一些路线错过了,任何建议都很感谢。

以下是关于集群的一些信息:

代码语言:javascript
复制
# kubectl get nodes
NAME                  STATUS   ROLES    AGE     VERSION
instance-4njec0xa-1   Ready    <none>   3h55m   v1.19.4
instance-4njec0xa-2   Ready    <none>   3h55m   v1.19.4
instance-4njec0xa-3   Ready    master   3h56m   v1.19.4

在主节点上

代码语言:javascript
复制
# ./calicoctl node status
Calico process is running.

IPv4 BGP status
+---------------+-------------------+-------+----------+-------------+
| PEER ADDRESS  |     PEER TYPE     | STATE |  SINCE   |    INFO     |
+---------------+-------------------+-------+----------+-------------+
| 192.168.0.194 | node-to-node mesh | up    | 04:10:41 | Established |
| 192.168.0.195 | node-to-node mesh | up    | 04:10:41 | Established |
+---------------+-------------------+-------+----------+-------------+

IPv6 BGP status
No IPv6 peers found.

# route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
0.0.0.0         192.168.0.1     0.0.0.0         UG    100    0        0 eth0
169.254.169.254 192.168.0.2     255.255.255.255 UGH   100    0        0 eth0
172.17.0.0      0.0.0.0         255.255.0.0     U     0      0        0 docker0
172.17.139.128  0.0.0.0         255.255.255.255 UH    0      0        0 cali96f39d92828
172.17.139.128  0.0.0.0         255.255.255.192 U     0      0        0 *
172.17.139.129  0.0.0.0         255.255.255.255 UH    0      0        0 caliccf893b1917
172.17.139.130  0.0.0.0         255.255.255.255 UH    0      0        0 cali09dc1beebda
172.17.153.64   192.168.0.194   255.255.255.192 UG    0      0        0 eth0
172.17.181.64   192.168.0.195   255.255.255.192 UG    0      0        0 eth0
192.168.0.0     0.0.0.0         255.255.240.0   U     100    0        0 eth0

在node1上

代码语言:javascript
复制
# ./calicoctl node status
Calico process is running.

IPv4 BGP status
+---------------+-------------------+-------+----------+-------------+
| PEER ADDRESS  |     PEER TYPE     | STATE |  SINCE   |    INFO     |
+---------------+-------------------+-------+----------+-------------+
| 192.168.0.195 | node-to-node mesh | up    | 04:10:42 | Established |
| 192.168.0.196 | node-to-node mesh | up    | 04:10:40 | Established |
+---------------+-------------------+-------+----------+-------------+

IPv6 BGP status
No IPv6 peers found.

# route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
0.0.0.0         192.168.0.1     0.0.0.0         UG    100    0        0 eth0
169.254.169.254 192.168.0.2     255.255.255.255 UGH   100    0        0 eth0
172.17.0.0      0.0.0.0         255.255.0.0     U     0      0        0 docker0
172.17.139.128  192.168.0.196   255.255.255.192 UG    0      0        0 eth0
172.17.153.64   0.0.0.0         255.255.255.192 U     0      0        0 *
172.17.153.69   0.0.0.0         255.255.255.255 UH    0      0        0 cali2587d39bec8
172.17.181.64   192.168.0.195   255.255.255.192 UG    0      0        0 eth0
192.168.0.0     0.0.0.0         255.255.240.0   U     100    0        0 eth0

在node2上

代码语言:javascript
复制
./calicoctl node status
Calico process is running.

IPv4 BGP status
+---------------+-------------------+-------+----------+-------------+
| PEER ADDRESS  |     PEER TYPE     | STATE |  SINCE   |    INFO     |
+---------------+-------------------+-------+----------+-------------+
| 192.168.0.194 | node-to-node mesh | up    | 04:10:42 | Established |
| 192.168.0.196 | node-to-node mesh | up    | 04:10:40 | Established |
+---------------+-------------------+-------+----------+-------------+

IPv6 BGP status
No IPv6 peers found.

# route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
0.0.0.0         192.168.0.1     0.0.0.0         UG    100    0        0 eth0
169.254.169.254 192.168.0.2     255.255.255.255 UGH   100    0        0 eth0
172.17.0.0      0.0.0.0         255.255.0.0     U     0      0        0 docker0
172.17.139.128  192.168.0.196   255.255.255.192 UG    0      0        0 eth0
172.17.153.64   192.168.0.194   255.255.255.192 UG    0      0        0 eth0
172.17.181.64   0.0.0.0         255.255.255.192 U     0      0        0 *
172.17.181.66   0.0.0.0         255.255.255.255 UH    0      0        0 cali12d4a061371
192.168.0.0     0.0.0.0         255.255.240.0   U     100    0        0 eth0
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2021-01-27 14:02:28

calico file默认禁用ipip和vxlan,这会导致网络故障。当我启用ipip并设置正确的veth_mtu时,一切工作正常。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/65897810

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档