Draft

Magically simplify your container application development process with it comes to Draft. It's the open source helper for container app development, generously bestowed on the masses by the devoted Microsoft's Deis team. You'll find it sitting pretty and inviting your curious click right here on Github.

Keyed by three main commands, Draft makes life a whole lot easier for developers:

  • draft init: Consider this the magician's wand granting life to your Docker registry account. It oversees image construction, pushes the images to the Docker registry, and manages app deployment in the Kubernetes cluster.

  • draft create: This little helper analyses your app's development language based on packs, and automatically spins up Dockerfile and Kubernetes Helm Charts.

  • draft up: This command is the muscle that brings it all together. It constructs images from Dockerfile and uses Helm to deploy your app to Kubernetes clusters (local or remote). No feeling of FOMO here - it simultaneously kicks off a Draft client on your local system to track code changes and push the updated code towards draftd.

Draft Installation: Getting Down to Business

Before you get all excited and install Draft, make certain you have:

  • A Kubernetes cluster on standby. If you're unsure about this step, check out the Kubernetes deployment guide.

  • Installed and initialized Helm (Ensure you have v2.4.x version and you definitely don't want to forget to run helm init). Here's a quick how-to on Helm for further reference.

  • Registered a Docker registry account - think Docker Hub or Quay.io.

  • Configured Ingress Controller and placed wildcard domain * A record (example: *.draft.example.com) in your DNS, pointing to the Ingress IP address. Check out the simplistic way of creating an Ingress Controller using Helm:

# Deploy nginx ingress controller
$ helm install stable/nginx-ingress --namespace=kube-system --name=nginx-ingress
# Wait for the completion of ingress controller configuration, and note the public IP
$ kubectl --namespace kube-system get services -w nginx-ingress-nginx-ingress-controller

minikube Ingress Controller

Learn how to configure and use Ingress Controller in minikube here.

Once you're all set with your Kubernetes cluster and Helm, you're good to download the Draft binary file here and set up Draft.

Draft Onboarding: Learning the Ropes

Dig into the Draft source code to find a wealth of examples. Let's take a look at how Draft can streamline the development process of a Python application.

Draft generates Dockerfile and chart using Draft create

Draft Up builds image and deploys application

Open up a new shell and voila! You can now access your application via the subdomain.

So go ahead, give Draft a spin. Let it cast its enchantment around your container app development process.

最后更新于