gpt4 book ai didi

istio - 配置 istio 目标规则以使用回退 URL 而不是 503

转载 作者:行者123 更新时间:2023-12-04 12:56:43 24 4
gpt4 key购买 nike

我知道您可以使用 istio 在服务没有响应时打开断路器。而不是返回 503 , 是否可以重定向到不同的 URL?同样的问题,但是当原始服务返回 500 时,我们可以重定向到另一个 URL 吗?
或者是否可以由 istio 提供离线模式响应?我认为最简单的方法是通过 URL 重定向到离线模式服务 URL,但对想法持开放态度......

最佳答案

can we redirect to another URL?


如果我理解正确,您会问是否可以仅使用 istio 来做到这一点。

根据 documentation

While Istio failure recovery features improve the reliability and availability of services in the mesh, applications must handle the failure or errors and take appropriate fallback actions. For example, when all instances in a load balancing pool have failed, Envoy returns an HTTP 503 code. The application must implement any fallback logic needed to handle the HTTP 503 error code.


dzone.com , Christian Posta blog post :

Istio improves the reliability and availability of services in the mesh. However, applications need to handle the errors and take appropriate fallback actions. For example, when all instances in a load balancing pool have failed, Envoy will return HTTP 503. It is the responsibility of the application to implement any fallback logic that is needed to handle the HTTP 503 error code from an upstream service.


With a service mesh, at the moment without specialized libraries for failure context propagation, the failure reasons are more opaque. This doesn’t mean our application cannot take fallbacks (for both transport and client-specific errors). I’d argue it’s very important for the protocol of any application, whether using library-specific frameworks OR NOT) to always adhere to the promises it’s trying to keep for its clients. If it finds that it cannot complete its intended action, it should figure a way to gracefully degrade. Luckily, you don’t need application-specific frameworks for this. Most languages have built-in error and exception trapping and handling. Fallbacks should be implemented in these exception paths.



可悲的是答案是 ,你不能。您必须在您的应用程序中实现它。

其他资源:
  • demystifying istio circuit breaking
  • istio circuit breaker when failure is an option
  • 关于istio - 配置 istio 目标规则以使用回退 URL 而不是 503,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/65927017/

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