consul ui入口资源仅在设置为/时才有效,而在/ consul中不起作用
与https://github.com/bitnami/charts/issues/764相同。
nginx.ingress.kubernetes.io/app-root
nginx.ingress.kubernetes.io/rewrite-target
我尝试一些配置,但仍然无法正常工作,因为我对这些配置不熟悉。
工作入口:
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: ingress-consul
annotations:
kubernetes.io/ingress.class: "nginx"
nginx.ingress.kubernetes.io/app-root: /consul
nginx.org/mergeable-ingress-type: "minion"
spec:
rules:
- host: 10.11.26.18.xip.io
http:
paths:
- backend:
serviceName: consul-cdp-qa
servicePort: 8500
path: /
测试
~ ᐅ curl http://10.11.26.18.xip.io
<a href="/ui/">Moved Permanently</a>.
无法使用入口:
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: ingress-consul
annotations:
kubernetes.io/ingress.class: "nginx"
nginx.ingress.kubernetes.io/app-root: /consul
nginx.org/mergeable-ingress-type: "minion"
spec:
rules:
- host: 10.11.26.18.xip.io
http:
paths:
- backend:
serviceName: consul-cdp-qa
servicePort: 8500
path: /consul
测试
~ ᐅ curl -I http://10.11.26.18.xip.io/consul
HTTP/1.1 404 Not Found
Server: nginx/1.17.4
Date: Tue, 08 Oct 2019 11:41:09 GMT
Connection: keep-alive
如何解决?