还有另一种对目标路由的分流方式,根据URL进行重定向
apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
name: nginx-default-v2
namespace: lizhe
spec:
hosts:
- nginx-service
http:
- match:
- headers:
ver:
exact: v2
route:
- destination:
host: nginx-service
subset: v2
- match:
- headers:
ver:
exact: v3
redirect:
uri: /index.html
- route:
- destination:
host: nginx-service
subset: v1