Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/kubernetes/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Kubernetes 如何在istio中将多个前缀路由到同一路由?_Kubernetes_Istio - Fatal编程技术网

Kubernetes 如何在istio中将多个前缀路由到同一路由?

Kubernetes 如何在istio中将多个前缀路由到同一路由?,kubernetes,istio,Kubernetes,Istio,如何在istio中将多个前缀路由到同一路由 例如: 前缀:/api 前缀:/something\u 如何将上述两个前缀路由到istio中的同一路由?来自istio官方: 路径以/wpcatalog/或开头的HTTP请求 /consumercatalog/将被重写为/newcatalog并发送到pods 标签为“版本:v2” 到目前为止你试过什么?请阅读,以便更好地回答您的问题。 apiVersion: networking.istio.io/v1alpha3 kind: VirtualServi

如何在istio中将多个前缀路由到同一路由

例如: 前缀:/api 前缀:/something\u

如何将上述两个前缀路由到istio中的同一路由?

来自istio官方:

路径以/wpcatalog/或开头的HTTP请求 /consumercatalog/将被重写为/newcatalog并发送到pods 标签为“版本:v2”


到目前为止你试过什么?请阅读,以便更好地回答您的问题。
apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
  name: reviews-route
spec:
  hosts:
  - reviews.prod.svc.cluster.local
  http:
  - match:
    - uri:
        prefix: "/wpcatalog"
    - uri:
        prefix: "/consumercatalog"
    rewrite:
      uri: "/newcatalog"
    route:
    - destination:
        host: reviews.prod.svc.cluster.local
        subset: v2
  - route:
    - destination:
        host: reviews.prod.svc.cluster.local
        subset: v1