【发布时间】:2020-05-24 19:42:28
【问题描述】:
我在 Minikube 上设置了一个“hello world”入口,如 the tutorial 中所述。唯一的区别 - 我删除了特定的主机名以使用“*”。但是,它似乎只适用于 minikube (minikube addons enable ingress) 提供的入口控制器。当我尝试禁用它并改用 helm install nginx-ingress stable/nginx-ingress 时,我无法再访问 Hello World 示例网站。我收到“连接被拒绝”错误:
$ kubectl get ingress
NAME HOSTS ADDRESS PORTS AGE
example-ingress * 192.168.64.6 80 6m23s
$ minikube ip
192.168.64.6
$ curl -iv "192.168.64.6"
* Rebuilt URL to: 192.168.64.6/
* Hostname was NOT found in DNS cache
* Trying 192.168.64.6...
* connect to 192.168.64.6 port 80 failed: Connection refused
* Failed to connect to 192.168.64.6 port 80: Connection refused
* Closing connection 0
curl: (7) Failed to connect to 192.168.64.6 port 80: Connection refused
如果我切换回内置插件,它会再次工作:
$ helm uninstall nginx-ingress
release "nginx-ingress" uninstalled
$ minikube addons enable ingress
✅ ingress was successfully enabled
$ curl -iv "192.168.64.6"
* Rebuilt URL to: 192.168.64.6/
* Hostname was NOT found in DNS cache
* Trying 192.168.64.6...
* Connected to 192.168.64.6 (192.168.64.6) port 80 (#0)
> GET / HTTP/1.1
> User-Agent: curl/7.38.0
> Host: 192.168.64.6
> Accept: */*
>
< HTTP/1.1 200 OK
HTTP/1.1 200 OK
* Server openresty/1.15.8.2 is not blacklisted
< Server: openresty/1.15.8.2
Server: openresty/1.15.8.2
< Date: Sun, 09 Feb 2020 07:06:58 GMT
Date: Sun, 09 Feb 2020 07:06:58 GMT
< Content-Type: text/plain; charset=utf-8
Content-Type: text/plain; charset=utf-8
< Content-Length: 59
Content-Length: 59
< Connection: keep-alive
Connection: keep-alive
<
Hello, world!
Version: 1.0.0
Hostname: web-9bbd7b488-wsvsw
* Connection #0 to host 192.168.64.6 left intact
是否可以安装以在 minikube 上正确使用此掌舵图?
【问题讨论】:
-
你能解决这个问题吗?
标签: kubernetes minikube nginx-ingress