我从K8S开始。我在 Azure 上安装了 2 个 Debian 10 VM(1 个主节点和 2 个从属节点)。
我用这个文档安装了主节点: https ://kubernetes.io/docs/setup/production-environment/tools/kubeadm/install-kubeadm/
我用这个安装了 Calico: https ://docs.projectcalico.org/getting-started/kubernetes/installation/calico#installing-with-the-kubernetes-api-datastore50-nodes-or-less
我创建了一个简单的 nginx 部署:
kubectl run nginx --replicas=2 --image=nginx
我有以下豆荚(sazultk8s1/2 是工作节点):
root@itf-infra-sazultk8s0-vm:~# kubectl get pods -o wide
NAME READY STATUS RESTARTS AGE IP NODE
nginx-6db489d4b7-mzmnq 1/1 Running 0 12s 192.168.47.18 itf-infra-sazultk8s2-vm
nginx-6db489d4b7-sgdz7 1/1 Running 0 12s 192.168.247.115 itf-infra-sazultk8s1-vm
从主节点我无法卷曲到这些 nginx:
root@itf-infra-sazultk8s0-vm:~# curl 192.168.47.18 --connect-timeout 5
curl: (28) Connection timed out after 5001 milliseconds
root@itf-infra-sazultk8s0-vm:~# curl 192.168.247.115 --connect-timeout 5
curl: (28) Connection timed out after 5000 milliseconds
我尝试了一个简单的busybox图像:
kubectl run access --rm -ti --image busybox /bin/sh
/ #ifconfig eth0 | grep -i inet
inet addr:192.168.247.116 Bcast:0.0.0.0 Mask:255.255.255.255
/ # wget --timeout 5 192.168.247.115
Connecting to 192.168.247.115 (192.168.247.115:80)
saving to 'index.html'
index.html 100% |********************************************************************************************************| 612 0:00:00 ETA
'index.html' saved
/ # wget --timeout 5 192.168.47.18
Connecting to 192.168.47.18 (192.168.47.18:80)
wget: download timed out
从头开始安装:
- 一个 pod 可以 ping 另一个主机上的一个 pod 吗?
- 是否可以从主节点卷曲到工作节点上的 pod?
- azure 是否应用限制并阻止 k8s 正常工作?