Getting started with docker swarm using a bare metal server

1/26/2019

So I have already images in my dockerhub which are ready to use as I have already setup a kubernetes cluster on a server. My next step is to achieve something similar using docker swarm. I do not really know how to get started so I am asking in here.

The kubernetes cluster is running on a bare metal ubuntu VPS server and looks like this:

enter image description here

My question is:

How to set up a single node cluster (one master only, no workers) on a bare metal ubuntu VPS? I did not found much out there, are there any significant changes I need to take care about (similar to the metalLB in the kubernetes cluster)?

-- elp
bare-metal-server
docker
docker-swarm
kubernetes

1 Answer

1/26/2019

How to set up a single node cluster (one master only, no workers) on a bare metal ubuntu VPS? I did not found much out there, are there any significant changes I need to take care about (similar to the metalLB in the kubernetes cluster)?

There's not much to do. You simply:

  1. Install the OS on your server. That may be from install media, or perhaps a network based scripted install. That's typically out of scope from docker and handled by the OS vendor or 3rd party tools.

  2. Install docker. That's well documented from docker, just select your OS from the list: https://docs.docker.com/install/

  3. Enable swarm with docker swarm init and you're done. If you have more than one network interface, you may need to specify an --advertise-addr option. https://docs.docker.com/engine/reference/commandline/swarm_init/

That's it, one command and you have a single node cluster. The lack of guides is more that there's little to do to get up and running.

-- BMitch
Source: StackOverflow