Docker Community Forums

Share and learn in the Docker community.

Connect external server to overlay network


(Lance Andersen) #1

I think it should be possible to join an non-docker server to an overlay network so that it may communicate on the same subnet.
Use case: I have a consul cluster outside of docker that we use for the swarm cluster configuration. We also want consul agents to run inside the overlay network where services can use them.

The problem is that the consul servers outside of docker can’t route to the overlay network.
I’m thinking this will entail manual veth pairs and a bridge on the non-docker server, but I haven’t been able to get it to work yet.


(Royee Tager) #2

Hi,

I have the same problem where I use an overlay network for my containers but the Consul servers (EC2 instances) reside in another network and, therefore, the Consul servers cannot monitor the containers.
Does anybody have a solution for that?


(Russlavoie) #3

This is what I am starting to look at right now. http://gliderlabs.com/registrator/latest/
or
https://aws.amazon.com/blogs/compute/service-discovery-via-consul-with-amazon-ecs/

If you use ecs

Hope one works for you.


(Royee Tager) #4

I’m already using registrator in order to register new services (containers) but still it doesn’t change the fact that the containers have different IP addresses (in the overlay network) which are different from the IP addresses that the Consul servers have.
Since the Consul servers cannot even ping the containers the monitoring function doesn’t work.
Currently I’m not going to use ECS as I’m already working with Swarm


(Jamshid) #5

It would be great if docker could handle this in the client. Imagine if a command like this existed:
docker network connectto my_overlay_or_bridged_network
that would configure routes and get a new ip for the local machine (e.g. your laptop or a non-docker server). I guess it would have to detect ip range collisions and fail with an error.

Then you could access the containers by their ip and exposed ports. This would be very useful when developing and debugging a service locally that talks to all the nodes of a scaled service.

If this sounds like a good approach, please upvote https://github.com/docker/docker/issues/22429.

If anyone knows if this is possible with some scripting, or if it’s not practical for some reason, please update the issue. Maybe the answer is "you need to use https://www.weave.works/ .