Draft is a tool designed to streamline development on Kubernetes, announced today. Sounds pretty useful to me - it looks like it could make it easy for developers to take advantage of Kubernetes without having to dive in and learn all the internals up front. Or for those who are already familiar with k8s - it could save some keystrokes, which I’m all for.
With that in mind, I thought it might be useful to try it out myself, and capture my step-by-step instructions as a guide for anyone else who wants to try it out.
- Azure CLI - I’m using Bash on Windows
I’m going to spin up a Kubernetes cluster in Azure using Azure Container Service. This makes setup super easy and then I can delete everything when I’m done playing around.
Draft uses a wildcard domain and an ingress controller to make life easier, so I set that up as well
My DNS is hosted on Cloudflare - I added the following
So that’s Kubernetes, Azure Container Service, and Helm. Last step - Draft itself.
The cluster is all set up. These steps are what a typical developer might experience after the Kubernetes guru configured the dev cluster. I followed along with the default Python example. Step-by-step below!
Draft saw my files, knew I had a Python app, and generated an appropriate Dockerfile & Helm Chart for me. Smart!
This will give you a crazy name, like http://washing-marmot.draft.noelbundick.com
This is all pretty cool so far. I started out with the most barebones of Python apps, and I’ve got a load balanced set of containers running on a real cluster. After the initial setup, all I have to do is run
draft up, and everything gets deployed without me having to worry about the details.
The next part is even better!
Open up app.py in an editor and save it. Draft watches your local file system, packages up your code in a new Docker container, and will make a live update on Kubernetes.
Note: Vim immediately registered a file change upon opening the file - Nano and VS Code gave me better results.
I don’t even have a Docker daemon running locally, so these are being built on my cluster - pretty neat!
If you close your terminal and want to get back up and running, just run
draft up in the folder again, and you’re back into watch mode.
I’m done playing with this cluster, and I don’t want to keep paying for it
Draft is still bleeding-edge. I’m looking forward to seeing it grow. Smarter tools like this are essential as technology grows in complexity - no one person can keep up with all the moving parts. I also think there’s an opportunity for tools like Draft to lower the barrier to entry so that more people have an opportunity to jump in, try things out, and contribute.