Currently I have setup an nginx ingress controller routing to my two services. Say /api and /app.
(https://docs.microsoft.com/en-us/azure/aks/ingress-tls)
What would be the best approach to communicate between /api and /app?
/api is running on port 80, and /app is running port 3000.
My Nginx ingress controller is the only service with an external IP of course. And the services have their own cluster IP, so how should one go about communicating between services here?
Edit: Because my services are in Go I will solve it programmatically. Thanks for your suggestions though :)
Use clusterIP type kubernetes service (operating at L4 layer) for east-west traffic between applications deployed in the same kubernetes cluster. Ingress(operating at L7 layer) is generally recommended for north south incoming traffic originated from outside the kubernetes cluster.
you can query your services like this:
your-namespace.your-service.cluster.local
the kubernetes cluster DNS will resolve and traffic will be routed internally