Hello !
I am trying to call service B from Service A. How do i get http endpoint when i call service B from service A. I am assuming the environment variable is magically populated ?please help.
Can you please elaborate a little on your question ? what do you mean by endpoint ?
endpoints for a service will be pod’s IP, you can do a "kubectl describe svc service-A -n ".
If you are using Kubernetes you have created a K8s Service for B. KubeDNS creates a DNS entry for B. If you invoke B in the usual way, e.g. curl http://B:<port>/
, it should just work.
Under the covers Istio might send the packets directly to one of B’s pods rather than going through the Virtual IP of the K8s Service B.
i had got it working @ed.snible . the way it works is service b dns is readily available to service a
K8s has folllowing naming convention
as my-svc.my-namespace.svc.cluster.local
so tweaking ur answer http://my-svc.my-namespace.svc.cluster.local:port/
Also initially i thought since istio is involved there will be istio specific way but seems like vanila k8s dns for service works
A design goal of Istio is that unmodified containers should be able to run within the mesh and gain traffic routing and telemetry. We don’t want to introduce new ways for applications to communicate.