其他分享
首页 > 其他分享> > virtualservice超时重试

virtualservice超时重试

作者:互联网

[root@k8s-master 09-http-retry]# kubectl apply -f ./
[root@k8s-master 09-http-retry]# cat virtualservice-demoapp.yaml 
apiVersion: networking.istio.io/v1beta1
kind: VirtualService
metadata:
  name: demoapp
spec:
  hosts:
  - demoapp
  http:
  - name: canary
    match:
    - uri:
        prefix: /canary
    rewrite:
      uri: /
    route:
    - destination:
        host: demoapp
        subset: v11
    fault:
      abort:
        percentage:
          value: 50
        httpStatus: 555
  - name: default
    route:
    - destination:
        host: demoapp
        subset: v10
    fault:
      delay:
        percentage:
          value: 50
        fixedDelay: 3s
[root@k8s-master 09-http-retry]# cat virtualservice-proxy.yaml 
apiVersion: networking.istio.io/v1beta1
kind: VirtualService
metadata:
  name: proxy
spec:
  hosts:
  - "fe.magedu.com"                     # 对应于gateways/proxy-gateway
  - "proxy"
  - "proxy.default.svc"
  gateways:
  - istio-system/proxy-gateway       # 相关定义仅应用于Ingress Gateway上
  - mesh
  http:
  - name: default
    route:
    - destination:
        host: proxy
    timeout: 1s
    retries:
      attempts: 5
      perTryTimeout: 1s
      retryOn: 5xx,connect-failure,refused-stream

 

 

标签:virtualservice,name,destination,重试,demoapp,proxy,http,超时
来源: https://www.cnblogs.com/zyyang1993/p/16613403.html