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

virtualservice超时重试

时间:2022-08-22 17:02:53浏览次数:70  
标签:virtualservice name destination 重试 demoapp proxy http 超时

[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,超时
From: https://www.cnblogs.com/zyyang1993/p/16613403.html

相关文章

  • 【JAVA】RestTemplate配置超时时间
    配置类:@BeanpublicRestTemplaterestTemplate(){SimpleClientHttpRequestFactoryrequestFactory=newSimpleClientHttpRequestFactory();......
  • virtualservice权重
    应用virtualservice[root@k8s-master06-weight-based-routing]#kubectlapply-fvirtualservice-demoapp.yaml[root@k8s-master06-weight-based-routing]#catvirt......
  • 技术分享 | 接口测试中,请求超时该怎么办?
    原文链接A发送请求,然后等待B的响应,同时开始超时计时,如果在超时时间内成功接收到响应,则结束等待和计时。如果到了超时时间还没有接收到响应,则结束等待同时此次通讯失败,......
  • 为方法增加一个超时等待
    为方法增加一个超时等待FindWindow查找窗口直接执行可能窗口还没有准备好,返回结果必然是0。通常使用Thread.Sleep进行阻塞等待,是一种有效的手段。因计算机CPU运算效率......
  • Pytest框架 — 14、Pytest的失败重试
    目录1、前言2、使用(一)命令行或main函数中使用(二)全局配置中使用(推荐用法)1、前言有时候我们测试执行由于某些原因失败了,想要多执行几次,Pytest可以使用pytest-rerunfailures......
  • ElasticSearch Java 客户端请求超时
    版本jdk:1.8elasticsearch:5.6.16elasticsearch-rest-high-level-client:5.6.16异常java.io.IOException:listenertimeoutafterwaitingfor[30000]ms atorg.el......
  • 关于SpringBoot整合redis使用Lettuce客户端超时问题
    问题起因使用到Lettuce连接redis,一段时间后不操作,再去操作redis,会报连接超时错误,在其重连后又可使用。原因是:Lettuce自适应拓扑刷新(Adaptiveupdates)与定时拓扑刷新(Peri......
  • go 重试机制
    packagemainimport("fmt""time")varRetryFlagchanbool=make(chanbool)funcmain(){Retry(test,[]int{3,5,10})}//重试次数funcRetry(ffunc()bool,rul......
  • 【面试】【5】如何取消超时未支付的订单?
    1、数据库轮询使用一个线程定时的去扫描数据库,通过订单时间来判断是否有超时的订单,然后取消操作缺点:存在延时,最差的延迟时间是设置的扫描间隔时间;对数据库性能消......
  • 不用定时器用接收超时做超时处理
    [原始代码]while(1){/*接收感兴趣的事件WRITE_EVENT,以永久等待方式去接收*/if(rt_event_recv(recvdata_event,WRITE_EVENT,RT_EVENT_FLAG_OR|RT_EV......