Kubernetes 1.4和weave-net:网络无法正常工作

时间:2016-12-14 13:16:50

标签: networking kubernetes atomic centos7 weave

我已经使用Kubeadm来引导群集,并添加了编织网

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

我已经把一切都运行了,但是我不能"看到"群集中任何已分配的IP。

所以:

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

1 个答案:

答案 0 :(得分:2)

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

通常情况下,我认为ping不起作用(除非你有一个处理icmp请求的Pod),所以我实际上并不认为这里有任何错误。

为了简单起见,只需运行一个Pod(最好来自部署)暴露端口可能为80,设置{{1}}并且您应该能够成功地卷曲Pod IP。还可以考虑使用稳定的IP来创建一个服务,该服务可以对匹配的Pod进行负载均衡请求,因为Pod可能来来去去。

希望它有所帮助!