Istio Service mesh virtual service in the class room

The following is from the Istio service mesh class room/course.

Currently this is confusing as 4 attributes of the VirtualService is assigned with same value i.e. ‘reviews’.
Can someone please explain what is the use of these attributes w.r.t. the example mentioned in the course.

Hi @debu3645 ,

Thank you for your question it’s a interested one :

  • The first reviews is the name of the VirtualServices he can be different my-reviews-vs for example he will not have impact on the configuration

  • The second, third and fourth, is the host, the name of the service, the address used by a client when attempting to connect to a service.

in this case is the same services but some rules are apply to redirect 99% of the traffic to v1 subset and 1% to v2 subset

Hi @mmkmou_KodeKloud
Thanks for the response.

  1. Thanks.
  2. So it seems the deployment has a k8s service with the name ‘reviews’. A virtualservice with the same name ‘reviews’ was also created. This virtualservice is trying to connect the k8s service(i.e. reviews).
    However one question still pops up regarding ‘host’ and ‘hosts’. If I understand the meaning of ‘hosts’ is to identify the service/gw from where an incoming request is coming. Because the incoming request is actually triggered from ‘productpage’ service, I would expect ‘productpage’ to be defined as ‘hosts’ in the virtualservice. Any thoughts on this.

Hi @debu3645

hosts mean The destination hosts to which traffic is being sent.

In this example all traffic routes to pods on services reviews 99% will be on v1 service label and 1% to service label v2