Skip to content

Azure/draft

main
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
cmd
 
 
 
 
 
 
pkg
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Draft

A tool to help developers hit the ground running with Kubernetes.

Report Bug · Request Feature

Draft Unit Tests GoDoc Go Report Card CodeQL Draft Linux Integrations Draft Release & Publish

Getting Started

Draft is a tool made for users who are just getting started with Kubernetes, or users who want to simplify their experience with Kubernetes. This readme will give you a quick run down on Draft’s commands and what they do.

draft create

In our directory that holds our application, we can run the CLI command ‘draft create’. Draft create will walk you through a series of questions prompting you on your application specification. At the end of it, you will have a Dockerfile as well as Kubernetes manifests to deploy your application. Below is a picture of running the Draft create command on our Contoso Air repository.

example of draft create command showing the prompt "select k8s deployment type" with three options "helm", "kustomize", and "manifests"

generate-workflow

Next up, we can run the ‘draft generate-workflow’ command. This command will automatically build out a GitHub Action for us. screenshot of command line executing "draft generate-workflow" printing "Draft has successfully genereated a Github workflow for your project"

setup-gh

If you are using Azure, you can also run the ‘draft setup-gh’ command to automate the GitHub OIDC setup process. This process is needed to make sure your Azure account and your GitHub repository can talk to each other. If you plan on using the GitHub Action to deploy your application, this step must be completed.

screenshot of command line executing "draft setup-gh" showing the prompt "Which account do you want to log into?" with two options "Github.com" and "Github Enterprise Server"

At this point, you have all the files needed to deploy your application onto a Kubernetes cluster!

If you don’t plan on using the GitHub Action, you can directly apply your deployment files by using the kubectl apply -f command.

If you plan on deploying your application through your GitHub Action, commit all the files to your repository and watch your application get deployed!

draft info

The draft info command prints information about supported languages and deployment types. Example output:

{
  "supported_languages": [
    "php",
    "python",
    "rust",
    "swift",
    "csharp",
    "go",
    "gradle",
    "javascript",
    "ruby",
    "clojure",
    "erlang",
    "gomodule",
    "java"
  ],
  "supported_deployment_types": [
    "helm",
    "kustomize",
    "manifests"
  ]
}

About The Project

Draft makes it easier for developers to get started building apps that run on Kubernetes by taking a non-containerized application and generating the Dockerfiles, Kubernetes manifests, Helm charts, Kustomize configuration, and other artifacts associated with a containerized application. Draft can also generate a GitHub Actions workflow file to quickly build and deploy applications onto any Kubernetes cluster.

Commands

  • draft create adds the minimum required Dockerfile and manifest files for your deployment to the project directory.
    • Supported deployment types: Helm, Kustomize, Kubernetes manifest.
  • draft setup-gh automates the GitHub OIDC setup process for your project.
  • draft generate-workflow generates a GitHub Actions workflow for automatic build and deploy to a Kubernetes cluster.
  • draft update automatically make your application to be internet accessible.
  • draft info print supported language and field information in json format.

Use draft [command] --help for more information about a command.

Prerequisites

Draft requires Go version 1.18.x.

Check your go version.

go version

Installation

  1. Clone the repo

    git clone https://github.com/Azure/draft.git
  2. Change to the draft directory and build the binary

    cd draft/
    make
  3. Add the binary to your path (we use the same directory as go install)

    mv draft $HOME/go/bin/

Install with HomeBrew

  1. Run the following commands

    $ brew tap azure/draft
    $ brew install draft

Installation using script

curl -fsSL https://raw.githubusercontent.com/Azure/draft/main/scripts/install.sh | bash
  • Windows isn't currently supported (you can use WSL)

Contributing

Draft is fully compatible with Azure Kubernetes Service. We strongly encourage contributions to make Draft available to other cloud providers 😊!

Issues/Discussions

The Draft team will be monitoring both the issues and discussions board. Please feel free to create issues for any problems you run into and the Draft team will be quick to respond. The discussions board will be used for community engagement. We look forward to see you there!

License

Draft is under the MIT License. See LICENSE for more information.

Trademark Notice

Authorized use of Microsoft trademarks or logos is subject to and must follow Microsoft’s Trademark & Brand Guidelines. Use of Microsoft trademarks or logos in modified versions of this project must not cause confusion or imply Microsoft sponsorship. Any use of third-party trademarks or logos are subject to those third-party’s policies.