Microsoft’s Deis has released Draft to makes it easy for developers to build applications that run on Kubernetes. Draft does this by providing tools and simplifying steps required to build for Kubernetes. If your enterprise has looked at containerization, Docker or Kubernetes before, this latest tool might very well nudge you to take the dive!
What is Draft? How Does It Fit into Kubernetes?
As its github account indicates, Draft targets the “inner loop” of a typical developer workflow: during the app-building and code-hacking, but before code is committed to a version control repository. At this time, applications written in six languages—Python (Newstar’s favorite language), Java, Go, Node.js, Ruby, PHP—are supported.
Using Draft is a simple three-step process fitting right into that developer “inner loop” we spoke before:
draft createto containerize your application based on Draft packs
draft upto deploy your application to a Kubernetes dev sandbox, accessible via a public URL
- Use a local editor to modify the application, with changes deployed to Kubernetes in seconds
draft create command will result in Draft creating a dockerfile and and Kubernetes Helm chart for that app.
Here is how it would look for an example Python app which uses Flask for an “Hello World” server:
$ draft create
--> Python app detected
--> Ready to sail
Dockerfile app.py chart/ draft.toml requirements.txt
draft.toml file contains basic configuration information about the application. See the Draft User Guide for further information and available configuration options on
Next would be invoking
draft up to deploy the app to a Kubernetes cluster.
$ draft up
--> Building Dockerfile
Step 1 : FROM python:onbuild
onbuild: Pulling from library/python
Successfully built 38f35b50162c
--> Pushing docker.io/microsoft/tufted-lamb:5a3c633ae76c9bdb81b55f5d4a783398bf00658e
The push refers to a repository [docker.io/microsoft/tufted-lamb]
5a3c633ae76c9bdb81b55f5d4a783398bf00658e: digest: sha256:9d9e9fdb8ee3139dd77a110fa2d2b87573c3ff5ec9c045db6009009d1c9ebf5b size: 16384
--> Deploying to Kubernetes
Release "tufted-lamb" does not exist. Installing it now.
--> Status: DEPLOYED
http://tufted-lamb.example.com to access your application
Watch local files for changes …
Once it has successfully deployed, interact with your app to make sure everything works correctly.
Keep in mind that Draft is experimental at this time but is shaping up to be a useful tool for those who want to dive into the world of containers but did not know how.