While I’m currently familiarizing myself with CoreOS and Docker, I thought it would be nice to try DigitalOcean as a hosting provider for this, because of the publicity that is made for them. So let me share my experience…

First, I wanted a nice way to integrate DigitalOcean’s API into my desktop environment. It turns out, there is a Python2 based digitalocean-indicator system tray application around, which can be installed from the AUR, if you’re an Arch Linux user like me.

1
$ pacaur -Sa python2-digitalocean digitalocean-indicator

After that I, created a DigitalOcean account to test it. It work flawlessly and has a nice minimalist interface:

digitalocean-indicator.jpg

At this point I was able to start and stop containers from my desktop, but that’s not enough for a really good user experience.

As some of you may know, there is a lot of work done via SSH terminals if you use a cloud provider like DigitalOcean. Even more if you use CoreOS’s fleet. You usually control your container instances, system services and cluster components all via SSH. You should try to do as much of this, as possible from your local machine.

It turns out, you can manage a whole CoreOS cluster, by just knowing a single IP address of an etcd cluster node (which we can get from our system tray app).

First I needed to install the client applications (etcdctl, docker and fleetctl), which are part of their respective server packages:

1
$ pacaur -Sa docker etcd fleet

Each of these is able to work against a remote service, which can be specified via command-line argument or environment variable:

1
2
3
4
export DOCKER_HOST="tcp://46.101.xxx.xxx:2375"
export ETCDCTL_PEERS="http://46.101.xxx.xxx:4001"
export FLEETCTL_ENDPOINT="http://46.101.xxx.xxx:4001"
export FLEETCTL_STRICT_HOST_KEY_CHECKING="false"

I added these variables to my desktop’s ~/.bashrc, as the IP address of my cluster node shouldn’t change that often.

FLEETCTL_STRICT_HOST_KEY_CHECKING makes fleetctl much more usable. Every time you re-image one of your CoreOS hosts you may get a ssh hostkey error when you try to use fleetctl. This variable disables this error only for fleetctl.

Now I can easily control my cluster from the local command-line.

1
2
3
4
5
6
7
$ etcdctl ls /
/coreos.com
$ docker images
REPOSITORY TAG IMAGE ID CREATED
$ fleetctl list-machines
MACHINE IP METADATA
cfb065fa... 46.101.xxx.xxx disk=ssd,platform=digitalocean,role=services

Next: Run your own CoreOS cluster on DigitalOcean

Cheers,
visit