Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Docker 1.12 Swarm Service External IP

Kubernetes allows you to create external IP's for services. In Docker Swarm is it possible to set an endpoint for each service separate from a node IP?

For instance:

  node1  192.168.1.22
  node2. 192.168.1.23

My service would be:

  myweb1  192.168.1.101. 80

So I would have tasks running on each node but the service would be accessible at http://192.168.1.101.

like image 369
Ken J Avatar asked Sep 10 '16 14:09

Ken J


People also ask

How do I access docker swarm service?

First, create overlay network on a manager node using the docker network create command with the --driver overlay flag. After you create an overlay network in swarm mode, all manager nodes have access to the network. The swarm extends my-network to each node running the service.

What is Swarm IP?

By default Docker Swarm uses a default address pool 10.0. 0.0/8 for global scope (overlay) networks.

Is docker swarm discontinued?

Mirantis announced that its managed Docker service will gradually switch from Swarm to Kubernetes as its main orchestrator.


1 Answers

You can't. A service in Swarm mode can only be assigned to an Overlay network so the service can't be exposed to the hosts' network without some bridging (ie: using the --publish option).

Note that internally (inside the Overlay network), Swarm allocates an ip for each service, irrespective of on which node(s) it runs.

like image 183
Bernard Avatar answered Oct 13 '22 21:10

Bernard