Hi All,
I am having issues with fabio setup on top of consul.
I'll tell you my use case directly, its a very basic one.
I have two nomad clients running an instance of nginx server each. This server is run as a service (specified in .nomad job file) and the client_port exposed is 80. No tags were specified in .nomad file. My nginx service has been recognized by consul and in the consul_UI it is showing those two clients on which this service is running, which is perfectly fine. Also when I use 'dig @
127.0.0.1 -p 8600 service_name.service.consul', it returns a valid response.
Now I want to use fabio to handle the requests for this server. I have started fabio on the same node on which consul server is running. So, I read in the official doc that I will have to register the service first on a consul API with 'name', 'port' and 'tags' key. And the format of 'tags' is "urlprefix-
host/path".
Here comes my question, according to my use case what should I write in place of
host/path. Do I have to write all the client_IPs on which nginx is running, i.e., register separately for all hosts or clients (as we call in nomad)?
And for the 'port' key, what if the ports are not statically defined, i.e., what if nomad is selecting the ports on its own randomly which happens by default?
FYI I am running those nginx server instances inside a container in the nodes. So, the mapping of container_port to node_port should be random and not static.
If possible, take me through the steps that I need to do to configure all this stuff.
Please help, I am stuck at this point. Nowhere to ask. Main thing being how to setup fabio for a service which is getting displayed in consul_UI.
Thanks and Regards
Ankit R