The thing is that if I setup my container on host network, I will not be able to access other containers if they are on “bridge” network, right?
I don’t want to share ports of all my containers on host network (a database server shouldn’t be reachable on host, but only from other containers).
But the container which controls the VIP has to be able to reach database.
So the question is:
If I want to control my host network interface, I have to set ALL my containers on “HOST” network mode? (because if not, they will not be able to communicate each other anymore)
frankly, i am unclear about the effect. Though, try declaring two networks and using the same network in the containers that should interact with each other and the other one strictly for frontend communication.
But the usecase for a nginx reverse proxy running in host mode and sending traffic to containers in a backend network ist not that uncommon. Just try and see
Well, one solution might be to create a macvlan network that uses a subset of your local lan, which is NOT handled by the networks DHCP Server. I am sure the search function will reveal some examples on how it’s created.
Then you declare a bridged network, which you only use for communication between containers.