Best practice Rancher + MicroServices

What is the best way to setup microservices in rancher using the default configurations - cattle.


Auth-Microservices running on localhost:9001
Order-Microservice running on localhost:9002
EventBus running on localhost:9000
  1. Do I make web service calls inside a docker container to localhost:port endpoints? this is how each service will communicate?
  2. But how would rancher handle this web service request? (when there are at least one service running on each host)
  3. Alternatively I use amazon load balancer and setup a public endpoint per microservice, that would work but I want communication of microservices to be private/internet and still have load balancing for the services, but what endpoint do i use and is load balancing setup by default?
  1. You use the service name as there is name resolution inside Rancher. Just like when you use Docker Compose. I suggest you try this with Compose. It’s a nice experience. So not localhost:9001, but auth-microservices:9001 and Rancher will resolve it to the correct host / ip.

I don’t fully get 2&3, can you elaborate?

Thanks, your response answers all 3 questions for me :slight_smile:

1 Like