gpt4 book ai didi

kubernetes - Istio是否允许为断路器打开配置最大响应超时?怎么样?

转载 作者:行者123 更新时间:2023-12-02 12:16:56 25 4
gpt4 key购买 nike

我正在检查documentation for the DestinationRule,其中有几个断路配置的示例,例如:

apiVersion: networking.istio.io/v1alpha3
kind: DestinationRule
metadata:
name: bookinfo-app
spec:
host: bookinfoappsvc.prod.svc.cluster.local
trafficPolicy:
connectionPool:
tcp:
connectTimeout: 30ms
...

connectionPool.tcp元素提供一个connectTimeout。但是,我需要配置的是最大响应超时。想象一下,如果服务需要5秒钟以上才能回答,那么我想断开电路。是否可以在Istio中进行配置?怎么样?

最佳答案

看看Tasks --> Traffic Management --> Setting Request Timeouts:

A timeout for http requests can be specified using the timeout field of the route rule. By default, the timeout is 15 seconds [...]



因此,必须在 http.timeout配置中设置 VirtualService
Virtual Service / Destination官方文档中查看以下示例:

The following VirtualService sets a timeout of 5s for all calls to productpage.prod.svc.cluster.local service in Kubernetes.


apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
name: my-productpage-rule
namespace: istio-system
spec:
hosts:
- productpage.prod.svc.cluster.local # ignores rule namespace
http:
- timeout: 5s
route:
- destination:
host: productpage.prod.svc.cluster.local

http.timeout: Timeout for HTTP requests.

关于kubernetes - Istio是否允许为断路器打开配置最大响应超时?怎么样?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55525582/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com