What the heck is Deis

Deis is a lightweight application platform that deploys and scales Twelve-Factor apps as Docker containers across a cluster of CoreOS machines. It features an automated Build/Release/Run workflow: Deis takes a git push and creates a new Docker image for the application. It then couples said image with the app's configuration to create a new numbered release. The release numbering is done every single time either code or configuration changes, making rollbacks dead-simple. The run stage then takes the release and rolls it out. The old app containers are only collected after the new containers are live and serving traffic – providing zero-downtime deploys. Oh, and Deis runs anywhere and is open source. In summary, it's delightful to work with.

Creating a Deis Cluster (in minutes)

Deis does have a few daunting requirements - ideally, it runs on a CoreOS cluster. Setting up clusters is rarely fun, but we created a small Python Script that does all of the heavy lifting for you. Go ahead and grab the requirements (the Deis repo, Python 2.7 with pip and the Azure SDK for Python):

The script will automate most of the cluster setup, but we do need to authorize it with a certificate. Enter the folder contrib/azure and run ./generate-mgmt-cert.sh - the command will use details in cert.conf to create a management certificate, so feel free to change it to your liking. To let Azure know that this is your certificate, log in to the Azure portal's certificate management. Select upload and select the just created azure-cert.cer file. While in the portal, also save the ids of the subscription and the name of the blob storage container you'd like to create the cluster in. If you don't have one yet, create one.

Cluster Configuration

Ready to create a cluster? You might want to configure a few basic things. The script create-azure-user-data will use defaults in ../coreos/user-data.example to create a configuration for you. If you want to stick with the defaults, go and run ./create-azure-user-data $(curl -s https://discovery.etcd.io/new) to create a configuration file.

Running the script

Our script is authorized, we have a configurtion file - in short, we're good to go!

Once the script is done, you'll have a running CoreOS cluster with three machines and one Cloud Service (working as a load balancer). To get its public IP, go back to the Azure Portal and check out your load balancer Cloud Service. We'll also need the public IP of one of its boxes (which you can find under Input Endpoints)

A wild cluster appears (let's configure it)

Deis has a command line tool that helps finishing the installation of all required parts. Let's install it.

With deisctl installed, go back to the deis/contrib/azure directory to inform the tool about our created cluster - by adding the domain and SSH private key. A quick word about domains and DNS: Ideally, you want a domain with a wildcard DNS record (*.domain.com), being the home to all of your apps that are going to run on that cluster. Being lazy, we'll just go with the Cloud Service's domain here though, but do check out the Deis documentation if you want to be serious with it.