【发布时间】:2022-01-26 18:50:33
【问题描述】:
我正在关注 this tutorial 在 Minikube 上使用 Ingress-Nginx 设置 Ingress。但我似乎无法让它工作。当我尝试连接到minikube ip 返回的 VM IP 地址上的端口 80 时,连接被拒绝
我的设置是这样的:
- Minikube 版本:v1.25.1
- VirtualBox 版本:6.1
- Kubernetes 版本:v1.22.5
ingress-nginx 命名空间有以下资源:
NAME READY STATUS RESTARTS AGE
pod/ingress-nginx-controller-85f4c5b458-2dhqh 1/1 Running 0 49m
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
service/ingress-nginx-controller NodePort 10.102.88.109 <none> 80:30551/TCP,443:31918/TCP 20h
service/ingress-nginx-controller-admission ClusterIP 10.103.134.39 <none> 443/TCP 20h
NAME READY UP-TO-DATE AVAILABLE AGE
deployment.apps/ingress-nginx-controller 1/1 1 1 20h
NAME DESIRED CURRENT READY AGE
replicaset.apps/ingress-nginx-controller-85f4c5b458 1 1 1 20h
NAME COMPLETIONS DURATION AGE
job.batch/ingress-nginx-admission-create 1/1 6s 20h
job.batch/ingress-nginx-admission-patch 1/1 6s 20h
默认命名空间有以下资源
NAME READY STATUS RESTARTS AGE IP NODE NOMINATED NODE READINESS GATES
pod/web-79d88c97d6-rvp2r 1/1 Running 0 47m 10.244.1.4 minikube-m02 <none> <none>
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE SELECTOR
service/kubernetes ClusterIP 10.96.0.1 <none> 443/TCP 20h <none>
service/web NodePort 10.104.20.14 <none> 8080:31613/TCP 20h app=web
NAME CLASS HOSTS ADDRESS PORTS AGE
ingress.networking.k8s.io/example-ingress nginx hello-world.info localhost 80 20h
Minikube 正在公开这些服务:
|---------------|------------------------------------|--------------|-----------------------------|
| NAMESPACE | NAME | TARGET PORT | URL |
|---------------|------------------------------------|--------------|-----------------------------|
| default | kubernetes | No node port |
| default | web | 8080 | http://192.168.59.106:31613 |
| ingress-nginx | ingress-nginx-controller | http/80 | http://192.168.59.106:30551 |
| | | https/443 | http://192.168.59.106:31918 |
| ingress-nginx | ingress-nginx-controller-admission | No node port |
| kube-system | kube-dns | No node port |
| kube-system | registry | No node port |
|---------------|------------------------------------|--------------|-----------------------------|
在Create an Ingress 部分的第 4 步教程中提到了这一点:
Add the following line to the bottom of the /etc/hosts file on your computer (you will need administrator access):
172.17.0.15 hello-world.info
Note: If you are running Minikube locally, use minikube ip to get the external IP. The IP address displayed within the ingress list will be the internal IP.
这是一个使用 VirtualBox 的三节点集群。我尝试将 Minikube ingress-nginx-controller 服务的 IP(192.168.59.106,这也是 minikube ip 的结果)添加到我的 hosts 文件中,但它不起作用。据我所知,我无法在 hosts 文件中包含服务的节点端口 30551 来测试它。
我们将不胜感激有关如何使这项工作发挥作用的一些指导
【问题讨论】:
标签: kubernetes virtualbox minikube nginx-ingress ingress-nginx