Docker Community Forums

Share and learn in the Docker community.

How do you call a LAN ip from inside a container without using network mode host

I have a large number of services related via docker compose. These create a microservice architecture with such services as logging, database access etc.
I have 2 services which need to talk to these other services and also connect to a rabbitqueue hosted on the LAN, outside of a container.
I solved this initally by using network mode host for these 2 services and used the ip and port of the rabbitqueue I wanted to connect to and used localhost for the other services.
However I now need to move to kubernetes and network mode host will not work since I cannot connect to the other services using localhost.
Is there an easy solution, I am new to kubernetes, so ideally would like to have a solution that works with docker/docker compose which I can then easily port to kubernetes.