Hello,
I have an application running in a Docker Swarm cluster, and now I'm trying to migrate to a Nomad/Consul cluster.
I configure a little cluster with a server and three clients for test purposes, the cluster is running perfectly, this isn't my problem.
My doubt is about networking. When I use Docker Swarm, I use an overlay network, and names are resolved to IP's in the overlay network, so all containers reach each other in this network, I don't need to expose the ports on host machines.
In a Nomad/Consul cluster, all ports are exposed dynamically in host machines and consul resolve names to these machines, my "problem" starts here.
For example, I have a MongoDB and a RabbitMQ running in my stack these are accessed by other applications in the same stack. The references to these resources include hostname and port, the default ports, 27017 and 5672.
To access these resources in Nomad/Cluster I'll probably turn the ports static, but if I have other applications with their own MongoDB and RabbitMQ, the managing of these ports becomes hard.
What solution do you recommend to solve this situation?
Is there some best practice for this scenario?
Thank you!