0

我在 Kubernetes 中有 2 种不同的服务。我的目的是把这些服务和应用程序后面的服务对外开放。问题是应用程序 index.html 有一个重定向,它会导致请求绕过主机匹配规则。

apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
  name: app1-vs
  namespace: customapp
spec:
  hosts:
  - mydomain.com
  gateways:
  - customapp-gateway
  http:
  - match:
    - uri:
        prefix: "/app1"
    route:
    - destination:
        host: app1.customapp.svc.cluster.local
        port:
          number: 80
---
apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
  name: app2-vs
  namespace: customapp
spec:
  hosts:
  - mydomain.com
  gateways:
  - customapp-gateway
  http:
  - match:
    - uri:
        prefix: "/app2"
    route:
    - destination:
        host: app2.customapp.svc.cluster.local
        port: 
          number: 81

我的意思是,mydomain.com/app1/index.html 将请求转发到不匹配规则的 mydomain.com/login 页面。我怎样才能弄清楚?

4

0 回答 0