kubernetes RPC micro-service with API gateway kubernetes RPC micro-service with API gateway kubernetes kubernetes

kubernetes RPC micro-service with API gateway


You shouldn't consume your RPC micro-service from a pod directly but through a Kubernetes service.

First, you have to expose your RPC as a public K8S service, that will provide you a port where it is listening. With the IP of the cluster (can be more than one, of course) and that port, you will be able to consume your RPC micro-service.

Check the docs to learn how to expose it:

https://kubernetes.io/docs/concepts/services-networking/service/

You can access a pod directly using hostNetwork configuration parameter. However, Kubernetes doesn't recommend it: https://kubernetes.io/docs/concepts/configuration/overview/

If you need to keep a shared session or something like that between your replicas, I would use another external component like Redis or something like that.