Я создал многокластерную среду kubernetes, и мои данные узла:
kubectl get nodes -o wide
NAME STATUS ROLES AGE VERSION INTERNAL-IP EXTERNAL-IP OS-IMAGE KERNEL-VERSION CONTAINER-RUNTIME
16-node-121 Ready <none> 32m v1.14.1 192.168.0.121 <none> Ubuntu 16.04.6 LTS 4.4.0-142-generic docker://18.9.2
master-16-120 Ready master 47m v1.14.1 192.168.0.120 <none> Ubuntu 16.04.6 LTS 4.4.0-142-generic docker://18.9.2
И я создал сервис и открыл сервис, используя следующую команду:
$kubectl expose deployment hello-world --port=80 --target-port=8080
Создано и выставлено. Подробная информация о моем сервисе:
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
hello-world ClusterIP 10.105.7.156 <none> 80/TCP 33m
Я раскрыл свое развертывание с помощью следующей команды:
kubectl expose deployment hello-world --port=80 --target-port=8080
service/hello-world exposed
К сожалению, когда я пытаюсь получить доступ к своему сервису с помощью команды curl, я получаю сообщение об ошибке тайм-аута:
Мои данные службы следующие:
master-16-120@master-16-120:~$ kubectl describe service hello-world
Name: hello-world
Namespace: default
Labels: run=hello-world
Annotations: <none>
Selector: run=hello-world
Type: ClusterIP
IP: 10.105.7.156
Port: <unset> 80/TCP
TargetPort: 8080/TCP
Endpoints: 192.168.1.2:8080
Session Affinity: None
Events: <none>
curl http://10.105.7.156:80
curl: (7) Failed to connect to 10.105.7.156 port 80: Connection timed out
Здесь я использую бязь для моей многокластерной сети:
wget https://docs.projectcalico.org/v3.3/getting-started/kubernetes/installation/hosted/rbac-kdd.yaml
wget https://docs.projectcalico.org/v3.3/getting-started/kubernetes/installation/hosted/kubernetes-datastore/calico-networking/1.7/calico.yaml
Сетевая спецификация My Pod:
sudo kubeadm init --pod-network-cidr=192.168.0.0/16