Kubernetes pod无法在计算机之间进行连接

时间:2016-01-06 00:31:09

标签: kubernetes coreos

我在这里使用node.yaml和master.yaml文件:http://kubernetes.io/v1.1/docs/getting-started-guides/coreos/coreos_multinode_cluster.html在运行CoreOS的3台裸机上创建一个多节点集群。但是,不同节点上的pod不能相互通信。我很感激任何指针或建议。我很茫然。

我有三个运行rabbitmq的pod:

thuey:~ thuey$ kbg pods | grep rabbitmq
rabbitmq-bootstrap     1/1       Running   0          3h
rabbitmq-jz2q7         1/1       Running   0          3h
rabbitmq-mrnfc         1/1       Running   0          3h

其中两个吊舱在一台机器上:

kbd node jolt-server-3 | grep rabbitmq
thuey               rabbitmq-bootstrap      0 (0%)      0 (0%)      0 (0%)      0 (0%)
thuey               rabbitmq-jz2q7          0 (0%)      0 (0%)      0 (0%)      0 (0%)

另一个pod在另一台机器上:

thuey:~ thuey$ kbd node jolt-server-4 | grep rabbitmq
thuey               rabbitmq-mrnfc          0 (0%)      0 (0%)      0 (0%)      0 (0%)

我可以成功ping从rabbitmq-bootstrap到rabbitmq-jz2q7:

root@rabbitmq-bootstrap:/# ping 172.17.0.5
PING 172.17.0.5 (172.17.0.5) 56(84) bytes of data.
64 bytes from 172.17.0.5: icmp_seq=1 ttl=64 time=0.058 ms
64 bytes from 172.17.0.5: icmp_seq=2 ttl=64 time=0.035 ms
64 bytes from 172.17.0.5: icmp_seq=3 ttl=64 time=0.064 ms
64 bytes from 172.17.0.5: icmp_seq=4 ttl=64 time=0.055 ms
^C
--- 172.17.0.5 ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 3000ms
rtt min/avg/max/mdev = 0.035/0.053/0.064/0.010 ms

但我不能ping rabbitmq-mrnfc:

root@rabbitmq-bootstrap:/# ping 172.17.0.8
PING 172.17.0.8 (172.17.0.8) 56(84) bytes of data.
From 172.17.0.2 icmp_seq=1 Destination Host Unreachable
From 172.17.0.2 icmp_seq=2 Destination Host Unreachable
From 172.17.0.2 icmp_seq=3 Destination Host Unreachable
From 172.17.0.2 icmp_seq=4 Destination Host Unreachable
^C
--- 172.17.0.8 ping statistics ---
5 packets transmitted, 0 received, +4 errors, 100% packet loss, time 4000ms
pipe 4

2 个答案:

答案 0 :(得分:1)

您使用的指南不包括裸机的说明。您需要实现Kubernetes networking model的网络(例如法兰绒,印花布)。您可以查看table of solutions了解不同IaaS / OS /网络组合的入门指南。

答案 1 :(得分:0)

事实证明问题是码头工人在法兰绒开始之前就开始了。这导致docker的dock被设置为默认值172.同时,法兰绒正在运行10个子网。为了解决这个问题,我刚从我的云配置中的docker.service添加了对法兰绒的依赖。一些有用的链接:

https://groups.google.com/forum/#!topic/coreos-user/KKnV1lA-ULs https://github.com/coreos/flannel/issues/246