Create your own CoreOS cluster in 6 easy steps for $0.03

1) Set up a Digital Ocean account

2) Add your local ssh key

Get help with this here if needed.

3) Get a personal access token

by clicking on “Generate New Token”.

4) Clone the repo

git clone https://github.com/ianmiell/shutit-coreos-do.git 

5) Copy and edit the Dockerfile subbing in your access token

cd shutit-coreos-do/cluster_setup/dockerfile
cp Dockerfile.eg Dockerfile
sed -i 's/YOUR_ACCESS_TOKEN/<your access token here>/' Dockerfile

6) Run the build

docker build --no-cache .

Well done! You’ve now got your own CoreOS cluster! Note the IPs were output at the end, eg:

$ docker build --no-cache .
[...]
# BUILD REPORT FOR BUILD END f63c037a8591_root_1421241306.32.323376
###############################################################################

droplet_id: 3776278: ip address: 104.131.77.227
Log in with: ssh core@104.131.77.227
droplet_id: 3776289: ip address: 104.131.77.207
Log in with: ssh core@104.131.77.207
droplet_id: 3776299: ip address: 104.236.71.247
Log in with: ssh core@104.236.71.247

and now we can ssh in and run some cool CoreOS stuff:

ssh core@IP

For example, to list the machines in the cluster:

core@coreos-1 ~ $ fleetctl list-machines
MACHINE IP METADATA
1970b296... 10.132.129.104 -
6a06628e... 10.132.129.103 -
d07d7634... 10.132.129.83 -

Make sure you switch it off before the hour is up or it will cost you another whole $0.03 per hour!

This method builds on the ShutIt project, and the ShutIt distro.

Any problems, please contact me below/via github issues/other social networks.

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.