我使用 Kubeadm 引导集群,并添加了 weave-net
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 上运行]