Working with CoreOS and Docker on DigitalOcean
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.
$ 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:
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 (
fleetctl), which are part of their respective server packages:
$ 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:
I added these variables to my desktop’s
~/.bashrc, as the IP address of my cluster node shouldn’t change that often.
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
Now I can easily control my cluster from the local command-line.
$ etcdctl ls /
$ docker images
REPOSITORY TAG IMAGE ID CREATED
$ fleetctl list-machines
MACHINE IP METADATA
cfb065fa... 46.101.xxx.xxx disk=ssd,platform=digitalocean,role=services