'How to call the services within a mesh in ISTIO?

I am using service mesh https://istio.io/ installed on top of kubernetes and have installed the example https://istio.io/docs/examples/bookinfo/, that ISTIO provides on their website.

Assume, I've created a service FOO and would like to call the service ratings through the virtual service ratings.

enter image description here

  • How to call ratings within FOO? Which address do I have to provide the http client in the FOO service to call ratings. Do Ihave to create a virtual service for ratings? ratings should not be accessible outside of kubernetes cluser.

  • When FOO calls ratings, will the request go first through the own envoy proxy or it goes directly to ratings envoy proxy?

Follow-up question

Here are all virtual services installed on the kubernetes cluster:

[enter image description here2

The cluster IP address is:

enter image description here

The question is, how can I call the ratings service in FOO service? With the Cluster IP address?



Solution 1:[1]

use "mesh" keyword in the list of gateways of a virtual service, inter service communication will also use these rules by the side cars and essentially leverage all additional rules configured for a particular service(like, retries)

Solution 2:[2]

I would suggest using Kubernetes DNS that is attached to a Kubernetes service that has the selectors for BOO service so that your traffic is redirected to BOO pods.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 shasi
Solution 2