Draft on Google Container Engine

deeeet
1 min readJun 1, 2017

At CoreOS Fest 2017, Microsoft Azure team announced Draft, a tool that streamlines application development and deployment into k8s cluster. It’s really cool to me. So I tried to install it on my test GKE cluster.

Installation of Draft is quite easy (see documentation) and it’s done less than 10 min. But there are some missing parts for doing it on Google Container Engine (GKE) with Google Container Registry. Here is small notes.

(If you don’t have) Setup GKE cluster,

$ gcloud container clusters create ${CLUSTER} \
--project ${PROJECT_ID} \
--zone ${ZONE}

Draft uses a wildcard domain. Since this is just trial, it’s too much to prepare the domain. So in this time, just using xip.io. After you’ve installed the nginx-ingress controller, you can get an external IP address of it. If it’s, for example, 35.181.245.100, you can use 35.181.245.100.xip.io for your Draft wildcard domain.

Draft needs to push docker images to a container registry. On GKE, it’s easy to use Google Container Registry. To do it, you need some auth token setup.

First, get the access token,

 $ gcloud auth application-default print-access-token
yn89.GlxcBB8ylkd...

Then, format & base64 encode the token,

$ echo '{"registrytoken":"yn89.GlxcBB8ylkd..."}' | base64 -w 0
eyJyZWdpc3RyeXRva2VuIjoieW44OS5HbH...

Now preparation is done. Run the following command and install Draft!

$ draft init --set registry.url=gcr.io,registry.org=${PROJECT_ID},registry.authtoken=eyJyZWdpc3RyeXRva2VuIjo,basedomain=35.181.245.100.xip.io

That’s it. Now you can start using Draft! Easy! Yay!

--

--

deeeet

Principal YAML engineer at Mercari platform group. https;://twitter.com/deeeet