Cuir in eagar

Comhroinn trí


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

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.

  1. Press Ctrl + Shift + P to open the command palette.
  2. Enter AKS Developer.
  3. Select AKS Developer: Get started.

You'll see the following getting started page:

Screenshot showing the Get started page in Visual Studio Code.

Draft a DockerFile

Draft a DockerFile adds the minimum required DockerFile to your project directory.

  1. Press Ctrl + Shift + P to open the command palette.
  2. Enter AKS Developer.
  3. 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.

  1. Press Ctrl + Shift + P to open the command palette.
  2. Enter AKS Developer.
  3. 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.

  1. Press Ctrl + Shift + P to open the command palette.
  2. Enter AKS Developer.
  3. 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.

  1. Press Ctrl + Shift + P to open the command palette.
  2. Enter AKS Developer.
  3. 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.