Kubernetes 1.4 和 weave-net:网络不工作

Kubernetes 1.4 and weave-net: networking not working

我已经使用 Kubeadm bootstrap 集群,并添加了 weave-net

kubectl apply -f https://git.io/weave-kube

并且我拥有 运行ning 的所有内容,但我无法 "see" 集群中任何已分配的 IP。

所以:

[centos@atomic01 ~]$ kubectl get pods --all-namespaces -o wide<br> NAMESPACE NAME READY STATUS RESTARTS AGE IP 节点 默认 hello-2533203682-b5usp 1/1 运行 0 13m 10.42.0.0 atomic03 默认测试 701078429-ely8s 1/1 运行 1 3h 10.40.0.1 atomic02 kube-system dummy-2088944543-6i81l 1/1 运行 0 5h 192.168.150.150 atomic01 kube 系统 etcd-atomic01 1/1 运行 0 5h 192.168.150.150 atomic01 kube-system kube-apiserver-atomic01 1/1 运行 0 5h 192.168.150.150 atomic01 kube-system kube-controller-manager-atomic01 1/1 运行 0 5h 192.168.150.150 atomic01 kube-system kube-discovery-982812725-c1kkw 1/1 运行 0 5h 192.168.150.150 atomic01 kube-system kube-dns-2247936740-nrszw 3/3 运行 2 5h 10.32.0.2 atomic01 kube-system kube-proxy-amd64-0y8ik 1/1 运行 1 5h 192.168.150.152 atomic03 kube-system kube-proxy-amd64-57y4o 1/1 运行 0 5h 192.168.150.150 atomic01 kube-system kube-proxy-amd64-mjpik 1/1 运行 1 5h 192.168.150.151 atomic02 kube-system kube-proxy-amd64-sh3ej 1/1 运行 1 5h 192.168.150.153 atomic04 kube-system kube-scheduler-atomic01 1/1 运行 0 5h 192.168.150.150 atomic01 kube-system kubernetes-dashboard-3095304083-xwuw8 1/1 运行 1 2h 10.38.0.0 atomic04 kube-system weave-net-edur9 2/2 运行 0 1m 192.168.150.151 atomic02 kube-system weave-net-l9xp3 2/2 运行 0 1m 192.168.150.150 atomic01 kube-system weave-net-sjpui 2/2 运行 0 1m 192.168.150.153 atomic04 kube-system weave-net-xu7j5 2/2 运行 0 1m 192.168.150.152 atomic03

应该能够ping通其他节点,但是

[centos@atomic01 ~]$ kubectl exec test-701078429-ely8s -- ping 10.42.0.0 PING 10.42.0.0 (10.42.0.0) 56(84) bytes of data. From 10.40.0.1 icmp_seq=1 Destination Host Unreachable From 10.40.0.1 icmp_seq=2 Destination Host Unreachable From 10.40.0.1 icmp_seq=3 Destination Host Unreachable

当然,这行得通:

[centos@atomic01 ~]$ kubectl exec test-701078429-ely8s -- ping 192.168.150.150 PING 192.168.150.150 (192.168.150.150) 56(84) bytes of data. 64 bytes from 192.168.150.150: icmp_seq=1 ttl=63 time=0.484 ms 64 bytes from 192.168.150.150: icmp_seq=2 ttl=63 time=0.448 ms

我 运行 没有想法,任何关于要测试或寻找的东西的线索将不胜感激。 [运行 在 Centos 7 Atomic 虚拟机上]

嗯,任何测试或你好 Pods 是否暴露任何端口?您可以从测试 pod 访问 hello pod 上的端口吗?

通常情况下,我不认为 ping 应该工作(除非你有一个处理 icmp 请求的 Pod),所以我实际上不认为这里有什么问题。

只需 运行 一个 Pod(最好来自 Deployment),为了简单起见,它可能会公开一个端口 80,设置 containerPort: 80 并且您应该能够成功地卷曲该 Pod IP。还可以考虑使用稳定的 IP 创建一个服务,该服务可以将请求负载平衡到匹配 Pods,因为 Pods 可能来来去去。

希望对您有所帮助!