|
| 1 | +--- |
| 2 | +title: Use Draft and the DevX extension for Visual Studio Code with Azure Kubernetes Service (AKS) (preview) |
| 3 | +description: Learn how to use Draft and the DevX extension for Visual Studio Code with Azure Kubernetes Service (AKS) |
| 4 | +author: schaffererin |
| 5 | +ms.topic: article |
| 6 | +ms.date: 03/20/2023 |
| 7 | +ms.author: schaffererin |
| 8 | +--- |
| 9 | + |
| 10 | +# Use Draft and the DevX extension for Visual Studio Code with Azure Kubernetes Service (AKS) (preview) |
| 11 | + |
| 12 | +[Draft][draft] is an open-source project that streamlines Kubernetes development by taking a non-containerized application and generating the DockerFiles, Kubernetes manifests, Helm charts, Kustomize configurations, and other artifacts associated with a containerized 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. |
| 13 | + |
| 14 | +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). |
| 15 | + |
| 16 | +[!INCLUDE [preview features callout](./includes/preview/preview-callout.md)] |
| 17 | + |
| 18 | +## Before you begin |
| 19 | + |
| 20 | +* 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][aks-acr-authenticate]. |
| 21 | +* Download and install the [Azure Kubernetes Service DevX Extension for Visual Studio Code][devx-extension]. |
| 22 | + |
| 23 | +## Draft with the DevX extension for Visual Studio Code |
| 24 | + |
| 25 | +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'll see available Draft commands: |
| 26 | + |
| 27 | +* Get started |
| 28 | +* Draft a DockerFile |
| 29 | +* Draft a Kubernetes Deployment and Service |
| 30 | +* Build an Image on Azure Container Registry |
| 31 | + |
| 32 | +### Get started |
| 33 | + |
| 34 | +The `Get started` command shows you all the steps you need to get up and running on AKS. |
| 35 | + |
| 36 | +1. Press **Ctrl + Shift + P** to open the command palette. |
| 37 | +2. Enter **AKS Developer**. |
| 38 | +3. Select **AKS Developer: Get started**. |
| 39 | + |
| 40 | +You'll see the following getting started page: |
| 41 | + |
| 42 | +:::image type="content" source="./media/draft-devx-extension-aks/draft-devx-extension-aks-get-started-page-vs-code.png" alt-text="Screenshot showing the Get started page in Visual Studio Code." lightbox="./media/draft-devx-extension-aks/draft-devx-extension-aks-get-started-page-vs-code.png"::: |
| 43 | + |
| 44 | +### Draft a DockerFile |
| 45 | + |
| 46 | +`Draft a DockerFile` adds the minimum required DockerFile to your project directory. |
| 47 | + |
| 48 | +1. Press **Ctrl + Shift + P** to open the command palette. |
| 49 | +2. Enter **AKS Developer**. |
| 50 | +3. Select **AKS Developer: Draft a DockerFile**. |
| 51 | + |
| 52 | +### Draft a Kubernetes Deployment and Service |
| 53 | + |
| 54 | +`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. |
| 55 | + |
| 56 | +1. Press **Ctrl + Shift + P** to open the command palette. |
| 57 | +2. Enter **AKS Developer**. |
| 58 | +3. Select **AKS Developer: Draft a Kubernetes Deployment and Service**. |
| 59 | + |
| 60 | +### Build an Image on Azure Container Registry |
| 61 | + |
| 62 | +`Build an Image on Azure Container Registry` builds an image on your ACR to use in your deployment files. |
| 63 | + |
| 64 | +1. Press **Ctrl + Shift + P** to open the command palette. |
| 65 | +2. Enter **AKS Developer**. |
| 66 | +3. Select **AKS Developer: Build an Image on Azure Container Registry**. |
| 67 | + |
| 68 | +## Next steps |
| 69 | + |
| 70 | +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][draft-aks-cli]. |
| 71 | + |
| 72 | +<!-- LINKS --> |
| 73 | + |
| 74 | +[draft-aks-cli]: ../aks/draft.md |
| 75 | +[aks-acr-authenticate]: ../aks/cluster-container-registry-integration.md |
| 76 | +[devx-extension]: https://marketplace.visualstudio.com/items?itemName=ms-kubernetes-tools.aks-devx-tools |
| 77 | +[draft]: https://github.com/Azure/draft |
0 commit comments