asisleep
asisleep

Reputation: 33

Best approach to communicate between services under ingress controller

Currently I have setup an nginx ingress controller routing to my two services. Say /api and /app.
(https://learn.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 :)

Upvotes: 0

Views: 537

Answers (2)

Rémi F
Rémi F

Reputation: 101

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

Upvotes: 1

Arghya Sadhu
Arghya Sadhu

Reputation: 44687

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.

Upvotes: 1

Related Questions