Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is swarm required for using multi-host networking feature using overlay in docker

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.

like image 995
Ankit Kumar Avatar asked Jan 20 '16 07:01

Ankit Kumar


Video Answer


1 Answers

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.

like image 192
VonC Avatar answered Oct 19 '22 23:10

VonC