Edit

Quickstart: Deploy Azure Container Linux (ACL) for Azure Kubernetes Service (AKS)

Azure Container Linux (ACL) for Azure Kubernetes Service (AKS) is an immutable, container-optimized operating system for AKS node pools. For more information, see Azure Container Linux for AKS.

In this quickstart, you learn how to:

  • Install the Azure CLI and kubectl.
  • Create an Azure resource group.
  • Deploy an AKS cluster that uses Azure Container Linux.
  • Connect to the cluster and verify the nodes.

Note

Azure Linux 4.0 is now in preview and is strictly limited to evaluation and testing purposes. It's not suitable for production use.

Prerequisites

  • An Azure subscription. If you don't have one, create a free account.

  • The latest version of Azure CLI. To install or upgrade Azure CLI, see Install Azure CLI.

  • The Kubernetes CLI, kubectl. To install it with Azure CLI, use the az aks install-cli command:

    az aks install-cli
    
  • Permissions to create resource groups and AKS clusters in your Azure subscription.

Set environment variables

Set the following environment variables to define the resource group name, cluster name, and location for your deployment. You can use the same values as shown here or replace them with names that are unique in your environment.

export RESOURCE_GROUP="acl-aks-rg"
export CLUSTER_NAME="acl-aks-cluster"
export LOCATION="eastus"

Create a resource group

Create an Azure resource group for the AKS cluster using the az group create command.

az group create \
  --name $RESOURCE_GROUP \
  --location $LOCATION

Create an AKS cluster that uses Azure Container Linux

Create an AKS cluster that uses ACL using the az aks create command with the --os-sku parameter set to AzureContainerLinux.

az aks create \
  --resource-group $RESOURCE_GROUP \
  --name $CLUSTER_NAME \
  --node-count 3 \
  --generate-ssh-keys \
  --os-sku AzureContainerLinux

The deployment takes a few minutes to complete.

Connect to the cluster

  1. After the cluster is deployed, configure kubectl to connect to it by retrieving the cluster credentials using the az aks get-credentials command.

    az aks get-credentials \
      --resource-group $RESOURCE_GROUP \
      --name $CLUSTER_NAME
    
  2. Verify the nodes are ready using the kubectl get nodes command to return a list of the cluster nodes.

    kubectl get nodes
    

    Example output:

    NAME                                STATUS   ROLES   AGE   VERSION
    aks-nodepool1-12345678-vmss000000   Ready    agent   5m    v1.34.4
    aks-nodepool1-12345678-vmss000001   Ready    agent   5m    v1.34.4
    aks-nodepool1-12345678-vmss000002   Ready    agent   5m    v1.34.4
    

Clean up resources

If you don't plan to continue using this cluster, delete the resource group to avoid ongoing charges using the az group delete command. Deleting the resource group removes the AKS cluster and all associated resources.

az group delete --name $RESOURCE_GROUP --yes --no-wait

To learn more about Azure Container Linux (ACL) and how it integrates with AKS, see the following resources: