I’m trying to use Consul with Rancher.
When my services start up, they fetch the IP from the container they run in.
This ends up being something like 220.127.116.11.
So when these services then try to register themselves inside Consul, consul think the services lives on the above IP.
This results in unreachable services as the containers can not use that IP for cross host communication.
Instead, what I want to get, is the virtual IP that is listed in the Rancher GUI, e.g 10.5.4.3.
If I use that IP from within the consul container, I can reach my services.
So, how do I get hold of the IP that Rancher thinks my container have, from within the container itself so that the services can annonce that IP to consul?