Does k8s internal service communicaton need to have virtual service setup?


#1

I am very new to istio, so I am still not very clearly about what scenario virtual service is targeting. I am using it with Gateway to config the routing rule and it works as expected.

My problem is, when i want to access a k8s internal service, such as I have a internal service call ServiceA without any sub version. so I have several container A deployed, and using label to select those pod for serviceA, which is just pure k8s way (but already inject by istio on A pod).

When there is another pod (already inject by istio), who want to access the serviceA, such as by “serviceA.namespaceA”. Should I just call the dns name directly without deploy any istio object. Or I should deploy a virtual service, and give a serviceA to serviceA routing? I am just confusing here, whether virtual service is a must have istio object I need to deploy? Or it is optional for internal service access?


#2

You do not need a VirtualService to access serviceA.namespaceA. Everything should the same as before.

You only need to create a VirtualService for an existing K8s Service if you wish to do additional things such as version-specific routing.


#3

Thanks very much for sharing those :slight_smile: