We are developing an application microservices based. They will be deployed to kubernetes with Helm Package Manager and all of them stored their own repository and helm chart. Below are the names of our microservices.
My confusion is, before the deployment how can I specify that backend's pod needs to be communicate with UI's , API's and Auth's Pods.App can know to make a connection to UI/AUTH/whatever but what is the best way to manage this between microservices pods.
The recommended way to manage the communication between microservices in Kubernetes is to use Services.
Basically, you need to wrap each of your microservices into a cluster IP service, then you are able to access its by the use of it's unique DNS record / Environment variables / by the use of a service mesh framework, like Linkerd
You can have one helm chart per microservice. That helmchart will contain yaml files for everything related to that microservice: deployments, config maps, secrets, etc., but also for the service (it's better to have a separate yaml file for it).
By the use of services, it's easy for the backend service to communicate with the rest of services, because the IP addresses of all the services will be injected in environment variables of the backend container, as you can see here
So you just have to update your backend app to read the IP of the microservice you want to connect to (from env variables) and then you are able to connect to it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With