【问题标题】:Kubernetes 1.4 and weave-net: networking not workingKubernetes 1.4 和 weave-net:网络不工作
【发布时间】:2017-01-06 21:36:00
【问题描述】:

我使用 Kubeadm 引导集群,并添加了 weave-net with

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 上运行]

【问题讨论】:

    标签: networking kubernetes atomic centos7 weave


    【解决方案1】:

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

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

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

    希望对你有帮助!

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2023-03-19
      • 2017-09-26
      • 2023-03-26
      • 1970-01-01
      • 2017-08-29
      • 2020-02-05
      • 2018-08-24
      • 2018-12-19
      相关资源
      最近更新 更多