Docker CoreOS Cluster in less than 10 Minutes


Install a Docker Cluster in less than 10 Minutes

This blog shows, how a Docker CoreOS cluster can be set up in ~10 minutes (dependent on your Internet speed), excluding the time to install Vagrant, Virtualbox and git.

2015.07.21-17_25_32-hc_001

In order to speed up the installation process of a CoreOS cluster, I have created a fork of the coreos-vagrant git repository. With that repository fork, a CoreOS cluster with 3 cluster nodes can be up and running and discovered in less than 10 minutes, if the prerequisites are met.

Prerequisites:

  • Vagrant, Virtualbox and git are assumed to be installed.
  • Unix tools like dos2unix is assumed to be installed, but any tool to convert the files is possible.

The procedure is tested on Windows, but should work on Linux as well. Please report any issues on https://github.com/oveits/coreos-vagrant or add a note on this blog.

1. Download Vagrant file like follows:
a) specify the HTTP proxy, if needed
(adapt IP address:Port to match your case:; use “export” instead of “SET” on Linux systems):

SET HTTP_PROXY=http://<your_proxy_IP>:<your_proxy_port>
SET HTTPS_PROXY=http://<your_proxy_IP>:<your_proxy_port>

b) download the Vagrant file

git clone https://github.com/oveits/coreos-vagrant
cd coreos-vagrant

c) on Windows, the files must be converted to UNIX format (minimum:  provision_ssh_agent_bashrc.sh must be in UNIX format). If bash is installed on the system, you can do the following (otherwise you might be able to use your editor, e.g. PSPAD, Ultraedit, … to do so):   bash   dos2unix * 

2. Adapt the configuration files

cp user-data.sample user-data

get token from https://discovery.etcd.io/new
copy token output to user-data file as:

discovery: https://discovery.etcd.io/<token>

adapt the Vagrantfile:

$num_instances=3

(more instances will take longer to boot up and be provisioned)

3. Start cluster:

vagrant up

4. Cluster discovery:
temporarily connect to the Internet, since HTTP proxy is not supported by etcd discovery
check https://discovery.etcd.io/<token> again
–> should show the nodes

etcd discovery output
Public etcd discovery service showing that it has learned about the three nodes

5. Connect to one of the nodes and check cluster health:

vagrant ssh core-01
etcdctl cluster-health

–> should show “healthy”
Oliver Veits

fleetctl list-machines

–> should show IP addresses of the nodes

DONE


3 thoughts on “Docker CoreOS Cluster in less than 10 Minutes

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s