为了避免按照程序本身的默认超时时间等待,可以加入 timeout
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
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