newsnowlabs / docker-ingress-routing-daemon

Docker swarm daemon that modifies ingress mesh routing to expose true client IPs to service containers
MIT License
182 stars 36 forks source link

show gateway ip address insted of client ip address #40

Open pouriyabp opened 1 month ago

pouriyabp commented 1 month ago

I run this script on my nodes, and my application get docker_gwbridge ip address instead of public ip address. before this script it get ingress ip address and after i run this it shows docker_gwbridge UP 172.18.0.1/16 any solution?

susnick commented 6 days ago

Maybe this will help, I have 4 nodes, one being the manager node. I use Traefik on this node. I Pretty much followed the dockerswarm.rocks tutorial.

The 3 worker nodes are the load balancers, and have an external IP as a virtual server that forwards to those 3 nodes. image

The swarm nodes are all on their own DMZ network.

As per instructions I ran ./docker-ingress-routing-daemon to obtain the worker gateway addresses.

Where the change was I had to run on all 4 nodes including the manager which does not handle requests. Without this change the entire swarm was non working. ./docker-ingress-routing-daemon --install --preexisting --tcp-ports 80,443 --ingress-gateway-ips 10.0.0.5,10.0.0.7,10.0.0.8

Once that was done, I like you was getting the gateway ip of my DMZ. I simply turned of NAT and that solved the problem

struanb commented 6 days ago

@susnick This is interesting. As the DIRD README states, it is required that "the daemon must be run on both load-balancer nodes and nodes running service containers".

If your manager node is not a load balancer but is running service containers, then it follows from that why DIRD must still be run on it (using e.g. the command you provided). DIRD must run to intercept service container launches on that node too.

However if your manager node is neither a load balancer nor running any service containers, then it's not obvious to me yet why you needed to run the DIRD daemon on it.

susnick commented 6 days ago

@struanb I have Swarmpit on the manager node as well, so maybe that was why.