Istio 12 url rewrite

Submitted by Lizhe on Tue, 06/23/2020 - 09:40

个人认为 rewrite 比 redirect 好用,因为rewrite可以和route一起工作

 

apiVersion: networking.istio.io/v1alpha3

kind: VirtualService

metadata:

  name: flaskapp-canary

  namespace: lizhe

spec:

  hosts:

  - flaskapp-service.lizhe.svc.cluster.local

  http:

    - match:

      - uri:

          prefix: /env/rewriteme1

      rewrite:

        uri: /env/version

      route: 

      - destination:

          host: flaskapp-service.lizhe.svc.cluster.local

          subset: v1

    - match:

      - uri:

          prefix: /env/rewriteme2

      rewrite:

        uri: /env/version

      route: 

      - destination:

          host: flaskapp-service.lizhe.svc.cluster.local

          subset: v2

20200603010334123

20200623054502