我的仪表板<dashboard>.foobar.com
毫无问题地暴露在外,现在我试图将上面提到的仪表板暴露给www.foobar.com/dashboard/<kiali>
我用一个简单的.net后端容器测试过这个VS设置:
apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
name: whatever
spec:
hosts:
- www.foobar.com
gateways:
- some-gateway
http:
- match:
- uri:
prefix: /bla
rewrite:
uri: " "
route:
- destination:
port:
number: 1234
host: dummy-service
然后我有:
foobar.com/bla/api/hello
-> dummyservice/api/hello
foobar.com/bla/api/deeper/hello
->dummyservice/api/deeper/hello
这很好。但是,如果我将相同的方法应用于这些仪表板,则没有任何效果!这是我对仪表板的设置:
apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
name: dashboards
namespace: istio-system
spec:
hosts:
- www.foobar.com
gateways:
- default/somegateway
http:
- name: grafana
match:
- uri:
prefix: /dashboards/grafana
rewrite:
uri: /
route:
- destination:
port:
number: 80
host: grafana.grafana.svc.cluster.local
- name: prometheus
match:
- uri:
prefix: /dashboards/prometheus
rewrite:
uri: "/"
route:
- destination:
port:
number: 9089
host: prometheus-server.prometheus.svc.cluster.local
- name: kubernetes-dashboard
match:
- uri:
prefix: "/dashboards/kubernetes"
rewrite:
uri: " "
route:
- destination:
port:
number: 8443
host: kubernetes-dashboard.kubernetes-dashboard.svc.cluster.local
- name: kubernetes-dashboard
match:
- uri:
prefix: "/dashboards/kiali/"
rewrite:
uri: /
route:
- destination:
port:
number: 20001
host: kiali.istio-system.svc.cluster.local
正如有人提到的那样,有一个已知问题,/
所以
你可以看到我rewrite
对他们两个都有。但仍然没有任何效果。大多数人都得到了 404,grafana 将我重定向到www.foobar.com/login
以前有人做过吗?我在想这些仪表板可能包含在前端,所以它不像我的 .net 后端容器那么简单?