Edit

Share via


Quickstart: Use Azure Container Storage with Azure Kubernetes Service

Azure Container Storage is a cloud-based volume management, deployment, and orchestration service built natively for containers. This quickstart shows you how to connect to a Linux-based Azure Kubernetes Service (AKS) cluster and install Azure Container Storage.

If you prefer the open-source version of Azure Container Storage, visit the local-csi-driver repository for alternate installation instructions.

Important

This article applies to Azure Container Storage (version 2.x.x). For earlier versions, see Azure Container Storage (version 1.x.x) documentation. If you already have Azure Container Storage (version 1.x.x) installed on your AKS cluster, remove it by following these steps.

Prerequisites

  • If you don't have an Azure subscription, create a free account before you begin.

  • This article requires the latest version (2.77.0 or later) of the Azure CLI. See How to install the Azure CLI. Don't use Azure Cloud Shell, because az upgrade isn't available in Cloud Shell. Be sure to run the commands in this article with administrative privileges. Some Azure CLI extensions, such as aks-preview, can conflict with required command flags. Disable them if you encounter issues.

  • You'll need the Kubernetes command-line client, kubectl. You can install it locally by running the az aks install-cli command.

  • Check if your target region is supported in Azure Container Storage regions.

  • If you haven't already created an AKS cluster, follow the instructions for Installing an AKS Cluster.

  • Sign in to Azure by using the az login command.

Install the required extension

Add or upgrade to the latest version of k8s-extension by running the following command.

az extension add --upgrade --name k8s-extension

Set subscription context

Set your Azure subscription context using the az account set command. You can view the subscription IDs for all the subscriptions you have access to by running the az account list --output table command. Remember to replace <subscription-id> with your subscription ID.

az account set --subscription <subscription-id>

Connect to the cluster

To connect to the cluster, use the Kubernetes command-line client, kubectl.

  1. Configure kubectl to connect to your cluster using the az aks get-credentials command. The following command:

    • Downloads credentials and configures the Kubernetes CLI to use them.
    • Uses ~/.kube/config, the default ___location for the Kubernetes configuration file. You can specify a different ___location for your Kubernetes configuration file using the --file argument.
    az aks get-credentials --resource-group <resource-group> --name <cluster-name>
    
  2. Verify the connection to your cluster using the kubectl get command. This command returns a list of the cluster nodes.

    kubectl get nodes
    
  3. The following output example shows the nodes in your cluster. Make sure the status for all nodes shows Ready:

    NAME                                STATUS   ROLES   AGE   VERSION
    aks-nodepool1-34832848-vmss000000   Ready    agent   80m   v1.32.6
    aks-nodepool1-34832848-vmss000001   Ready    agent   80m   v1.32.6
    aks-nodepool1-34832848-vmss000002   Ready    agent   80m   v1.32.6
    

Ensure VM type for your cluster meets the following criteria

Follow these guidelines when choosing a VM type for the cluster nodes.

Install Azure Container Storage on your AKS cluster

Run the following command to install Azure Container Storage on the cluster. Replace <cluster-name> and <resource-group> with your own values.

az aks update -n <cluster-name> -g <resource-group> --enable-azure-container-storage

The deployment will take 5-10 minutes. When it completes, you'll have an AKS cluster with Azure Container Storage installed and the components for local NVMe storage type deployed.

Next step