Docker Community Forums

Share and learn in the Docker community.

Load balancing traffic between forwarder containers with docker swarm

swarm
docker

(Roy Cohen) #1

I have containers with an externally accessible IP address using macvlan networks.
The containers are connected to multiple networks, so they can accept traffic from one networks and pass it to another.

I am trying to use the containers as “hops” and not as the final destination for the traffic that reaches them, by creating appropriate routing rules to route traffic through the containers.
The containers run a software that sniffs/ examines the traffic.

I want to load balance this architecture. for example, if host a wants to ping host b, the traffic will go through one of the containers. if this container “dies”, the traffic will pass through the other one. Also, some traffic shall go through the other container for actual load balancing.

from what I’ve seen, Docker Swarm’s load balancing mechanism is port based, and only works when the containers publish ports.

Is such load balancing type achievable with swarm or any other container orchestration platform? there are no ports involved here, as the container is not the final destination of most of the packets that come through it.