Dev Adopt Kubernetes – Microsoft’s Deis releases Draft that 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, kubernetes before and looked and looked, this latest tool might very well nudge you to take the dive!
As Draft’s github account indicates, it targets the “inner loop” of a typical developer workflow: right when they are building an app and hacking code 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 3 step process fitting right into that developer “inner loop” we spoke before:
draft create
to containerize your application based on Draft packsdraft up
to deploy your application to a Kubernetes dev sandbox, accessible via a public URLRunning the 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
$ ls
Dockerfile app.py chart/ draft.toml requirements.txt
The draft.toml
file contains basic configuration information about the application. See the Draft User Guide for further information and available configuration options on draft.toml
.
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
--> Notes:
http://tufted-lamb.example.com to access your application
Watching local files for changes…
Once successfully deployed, interact with your app to make sure it all works right!
Keep in mind that Draft is experimental at this time but is shaping up to be a useful tool for those who desire to take a dive into the world of containers and Kubernetes but so far did not know how!