9

I have followed through the example at getting started overlay and i have a simple query. Is it possible to use multi-host networking feature using overlay without creating a swarm cluster? I don't want to use third party plugins like weave etc. I want to use docker native networking support for this.

I have 3.16+ kernel running RHEL and docker 1.9.

Édouard Lopez
  • 40,270
  • 28
  • 126
  • 178
Ankit Kumar
  • 1,433
  • 1
  • 16
  • 24

1 Answers1

10

Yes, it is possible: see "Lab 6: Docker Networking".
The key part of an overlay network is the discovery service, like for instance Consul.

An overlay network requires a key-value store.
The store maintains information about the network state which includes discovery, networks, endpoints, ip-addresses, and more. Engine supports Consul, etcd, and ZooKeeper (Distributed store) key-value store stores.

https://github.com/docker/dceu_tutorials/raw/master/images/tut6-step1.png

The article "Docker Networks: Discovering Services on an Overlay" lay some criticisms about the current service discovery tools which are not built for individual container registration or discovery.

Overlay uses KV stores under the covers to model the network topology and enable cross-host container to container communication. It does not provide SRV record resolution.

The rub is that in an overlay network every container has its own IP address.
So, the only way you could make this work is by running Consul agents inside of every container on the network that contributes a service. That is certainly not transparent to the developer, or compatible with off-the-shelf images.

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • Thanks @VonC . I somehow wasn't aware of this documentation availability at github. :-) – Ankit Kumar Jan 20 '16 at 08:03
  • One more doubt @VonC, Can we not launch the `KV` store image (zookeeper etc. ) on one of the nodes where clustered containers are to be run? – Ankit Kumar Jan 25 '16 at 05:33
  • 1
    @AnkitKumar yes you can. Don't forget to restart docker with the right options (https://github.com/docker/dceu_tutorials/blob/94fd5f3e9372a8f58ca7b25f3232305731f7cd36/06-networking.md#task-2-configure-the-engine-to-use-key-value-store). that node needs to be reachable by the others. It is better to keep it separate on its own node though. – VonC Jan 25 '16 at 05:47
  • Out of curiosity @AnkitKumar why have you opted for multi host networking without the swarm ? – Ciasto piekarz Sep 29 '22 at 21:06