Question:I’m very new to Istio and not a Kubernete’s expert, though I have used the latter. I respectfully ask for your understanding and a bit more details than you might normally include.
For simplicity, say I have two services, both Java/SpringBoot. Service A listens to requests from the outside world, Service B listens to requests from Service A. Service B is scalable, and at points might return 503. I wish to have service A retry calls to service B in a configurable non-programmatic way. Here’s a blog/link that I tried to follow that I think is very similar.
It may seem obvious, but if I wanted to define a virtual retriable service, do I add it to the existing application.yml file for the project or is there some other file that the networking.istio.io/v1alpha3 goes?
Would I define the retry configuration in the yaml/repo for Service A or Service B? I can think of reasons for architecting Istio either way.
Answer:If the scalable service is returning
503, it makes sense to add a virtual service just like the blog example for
virtualServiceBwhich will do the retries to
Now, for this to work (from within the cluster):
apiVersion: networking.istio.io/v1alpha3 kind: VirtualService metadata: name: serviceB spec: hosts: – serviceB http: – route: – destination: host: serviceB retries: attempts: 3 perTryTimeout: 2s
Will tell the default Istio Gateway (mesh) to route all the traffic not to
hosts: – serviceB
serviceB, but to
virtualServiceBfirst which will then route to
ServiceB. Then you will have retries from
Hope this helps
If you have better answer, please add a comment about this, thank you!