Services connecting to their own host

Hi!

I’m having a bit of trouble where containers on the same host as a service cannot access that service using the host IP. I believe this is a docker problem not a Rancher one, but I’m interested if people have any ideas.

We have multiple environments. I’ll simplify that by saying we have “qa,” “production,” and “secure.”

We have a message queue that we expose through DNS as “servicequeue.internal.domain” That is listening on host ports because we use the same message queue in all three environments and externally. We use “external_service” with a “hostname” entry in our rancher compose in all our other stacks.

Now… any container that gets scheduled on a host that’s running the “servicequeue” cannot access the service queue because it’s trying to use its own host IP to access…

As in… consumer is on host 192.1.1.2 and servicequeue is on 192.1.1.2 and so consumer is trying to access 192.1.1.2:5672

We could use external service with a service name inside the production environment and dns outside of it… but then any stack developer needs to know to do that in their own stacks… “production is different than everything else.”

Any ideas?

It sounds like you’re running into this issue: