配置如下
apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
name: nginx-default-v2
namespace: lizhe
spec:
hosts:
- nginx-service
http:
- match:
- headers:
ver:
exact: v2
timeout: 3s
retries:
attempts: 3
route:
- destination:
host: nginx-service
subset: v2
- match:
- headers:
ver:
exact: v3
redirect:
uri: /index.html
- route:
- destination:
host: nginx-service
subset: v1
timeout: 3s
retries:
attempts: 3