5

I have a small cluster at rackspace with a private network in the range 192.168.3.0/24. I would like my worker services to talk to each other using this network but can't figure out how to get docker to allow that.

My ideal configuration would be a single public-facing container that proxies the connections to a worker that can then talk to various services within the private network to do its job.

eth0 -> load balancer --> 192.168.3.3:80 --> 192.168.3.5:1234 (db)
                      \-> 192.168.3.4:80 /
                       \> 192.168.3.5:80/

If all the workers were on the same machine I could accomplish this with docker run --link ... but since they're on different machines, that won't work.

The workers in the above example are started with a command similar to this:

docker run -d -p $PRIVATE_IPV4:80:80 myworker

and the database started like this:

docker run -d -p $PRIVATE_IPV4:1234:1234 mydb

From the host I can talk to each of the containers just fine but each container cannot route to any other container. I.E. curl http://192.168.3.4 works from the host, but not from a container running on the host.

The load balancer in this case is nginx started like this:

docker run -d -p $PUBLIC_IPV4:80:80 nginx

nginx.conf

upstream app {
  server 192.168.3.3:80;
  server 192.168.3.4:80;
  server 192.168.3.5:80;
}
...

This seems like it would be a pretty standard configuration. What am I doing wrong?

0

You can try implementing your architecture in a container manager like Kubernetes on top of CoreOS. There are many guides out there. This is a walk-through from a presentation at DockerCon https://www.brighttalk.com/webcast/11427/136165 about Container Cluster Management.

0

Currently, Docker by itself does not provide container networking facilities. Weave is one of the easiest to use overlay SDN solutions. It works in any cloud and even across multiple clouds.

I should disclaim, I am one of Weave engineering team.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.