apiVersion: networking.istio.io/v1beta1kind: VirtualServicemetadata:name: testspec:gateways:- default/example-gwhosts:- 'test.example.com'http:- match:- uri:prefix: /usrvrewrite:uri: /route:- destination:host: usrv.default.svc.cluster.localport:number: 80- match:- uri:prefix: /usrv-expandrewrite:uri: /route:- destination:host: usrv-expand.default.svc.cluster.localport:number: 80
/usrv, which indicates that the request will be forwarded to the first service as long as the access URI prefix contains /usrv. Because the second matching URI /usrv-expand is also a prefix containing /usrv, the request will never be forwarded to the service matching the second URI.apiVersion: networking.istio.io/v1beta1kind: VirtualServicemetadata:name: testspec:gateways:- default/example-gwhosts:- 'test.example.com'http:- match:- uri:prefix: /usrv-expandrewrite:uri: /route:- destination:host: usrv-expand.default.svc.cluster.localport:number: 80- match:- uri:prefix: /usrvrewrite:uri: /route:- destination:host: usrv.default.svc.cluster.localport:number: 80
apiVersion: networking.istio.io/v1beta1kind: VirtualServicemetadata:name: testspec:gateways:- default/gatewayhosts:- 'test.example.com'http:- match:- uri:regex: "/usrv(/.*)?"rewrite:uri: /route:- destination:host: nginx.default.svc.cluster.localport:number: 80subset: v1- match:- uri:regex: "/usrv-expand(/.*)?"rewrite:uri: /route:- destination:host: nginx.default.svc.cluster.localport:number: 80subset: v2
Feedback