I understand you can use istio to open a circuit breaker when service isn't responding. Instead of return back a 503
, is it possible to redirect to a different URL? Same question but when the original service returns back a 500
, can we redirect to another URL?
Or is it possible to have offline mode response provided by istio? I assume the easiest way to do this through URL redirection to a offline mode service URL, but open to ideas...
can we redirect to another URL?
If I understand correctly you're asking if it's possible to do that just with istio.
According to 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.
And 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.
Sadly the answer is no, you can't. You would've to implement that in your application.
Additional resources: