I'm trying to do a paper evaluation of deploying our system on Nomad. There are maybe a dozen internal service processes, all packaged as Docker containers, some but not all of which communicate via HTTP.
When I start my
client tasks, where do I tell them to connect? I can't just say
-connectTo http://server.service.consul/ because Nomad almost certainly won't have picked port 80; and I don't have a config file (I need either command-line parameters or environment variables) so it seems like consul-template won't work for me. I've seen some suggestions to use HAProxy as an intermediary, also helping the case where there is more than one copy of the service, but this seems like it just kicks the problem down the road.
Maybe the right answer is to use a dynamic port for each service instance, then pick static ports for the load balancer (this is hinted in the
network { ... } documentation), and then tell clients
-connectTo http://proxy.service.consul:12345/? Should I have one proxy per service, or one per deployment?
("How we do it today" is a hand-rolled set of docker run scripts, where we have in fact picked a static port per service, but that makes upgrades and migrations a problem.)