Use Draft and the DevX extension for Visual Studio Code with Azure Kubernetes Service (AKS)
Draft is an open-source project that streamlines Kubernetes development. It takes a non-containerized application and generates the DockerFiles, Kubernetes manifests, Helm charts, Kustomize configurations, and other artifacts associated the application. The Azure Kubernetes Service (AKS) DevX extension for Visual Studio Code enhances non-cluster experiences, allowing you to create deployment files to deploy your applications to AKS. Draft is the available feature included in the DevX extension.
This article shows you how to use Draft with the DevX extension to draft a DockerFile, draft a Kubernetes deployment and service, and build an image on Azure Container Registry (ACR).
Before you begin
- You need an Azure resource group and an AKS cluster with an attached ACR. To attach an ACR to your AKS cluster, use
az aks update -n <cluster-name> -g <resource-group-name> --attach-acr <acr-name>
or follow the instructions in Authenticate with ACR from AKS. - Download and install the Azure Kubernetes Service DevX Extension for Visual Studio Code.
Draft with the DevX extension for Visual Studio Code
To get started with Draft in Visual Studio Code, press Ctrl + Shift + P in your Visual Studio Code window and enter AKS Developer. From here, you see the available Draft commands:
- Get started
- Draft a DockerFile
- Draft a Kubernetes Deployment and Service
- Build an Image on Azure Container Registry
Get started
The Get started
command shows you all the steps you need to get up and running on AKS.
- Press Ctrl + Shift + P to open the command palette.
- Enter AKS Developer.
- Select AKS Developer: Get started.
You'll see the following getting started page:
Draft a DockerFile
Draft a DockerFile
adds the minimum required DockerFile to your project directory.
- Press Ctrl + Shift + P to open the command palette.
- Enter AKS Developer.
- Select AKS Developer: Draft a DockerFile.
Draft a Kubernetes Deployment and Service
Draft a Kubernetes Deployment and Service
adds the appropriate deployment and service files to your application, which allows you to deploy to your AKS cluster. The supported deployment types include: Helm, Kustomize, and Kubernetes manifests.
- Press Ctrl + Shift + P to open the command palette.
- Enter AKS Developer.
- Select AKS Developer: Draft a Kubernetes Deployment and Service.
Build an Image on Azure Container Registry
Build an Image on Azure Container Registry
builds an image on your ACR to use in your deployment files.
- Press Ctrl + Shift + P to open the command palette.
- Enter AKS Developer.
- Select AKS Developer: Build an Image on Azure Container Registry.
Draft a GitHub Action Deployment Workflow
Draft a GitHub Action Deployment Workflow
adds a GitHub Action to your repository, allowing you initiate an autonomous workflow.
- Press Ctrl + Shift + P to open the command palette.
- Enter AKS Developer.
- Select AKS Developer: Draft a GitHub Action Deployment Workflow.
Next steps
In this article, you learned how to use Draft and the DevX extension for Visual Studio Code with AKS. To use Draft with the Azure CLI, see Draft for AKS.
Azure Kubernetes Service
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for