Edit

Reduce time to deployment with Artifact Streaming on Azure Kubernetes Service (AKS) with Azure Container Registry (ACR)

Large container images can increase image pull time and delay workload deployment. Artifact Streaming allows you to stream container images from Azure Container Registry (ACR) to Azure Kubernetes Service (AKS). AKS only pulls the necessary layers for initial pod startup, reducing the time it takes to deploy your workloads.

This article describes how to enable and disable the Artifact Streaming feature on your AKS node pools to stream artifacts from ACR.

Prerequisites

Limitations

  • Only images with Linux AMD64 architecture are supported.
  • Windows-based container images and ARM64 images aren't supported.
  • Only the AMD64 architecture is supported for multi-architecture images.
  • Ubuntu based node pools in AKS must use Ubuntu version 20.04 or higher.
  • Only Premium SKU ACR registries are supported.
  • CMK (Customer-Managed Keys) registries aren't supported.
  • Kubernetes regcred, such as imagePullSecrets, isn't supported. Image pulls from ACR using non-Entra scope-mapped token credentials or ACR admin user credentials default to non-Artifact Streaming pulls, even if the node pool and image are enabled for streaming.
  • Artifact Streaming only supports image pulls by tag. Artifact Streaming works by resolving image pulls by tag to a streaming variant of the image. If image pulls are done by digest, you can't use Artifact Streaming.

Enable Artifact Streaming on ACR

  1. Create an Azure resource group to hold your ACR instance using the az group create command.

    az group create --name myStreamingTest --location westus
    
  2. Create a new Premium SKU ACR using the az acr create command with the --sku Premium flag.

    az acr create --resource-group myStreamingTest --name mystreamingtest --sku Premium
    
  3. Configure the default ACR instance for your subscription using the az configure command.

    az configure --defaults acr="mystreamingtest"
    
  4. Push or import an image to the registry using the az acr import command.

    az acr import --source docker.io/jupyter/all-spark-notebook --repository jupyter/all-spark-notebook
    
  5. Create a streaming artifact from the image using the az acr artifact-streaming create command.

    az acr artifact-streaming create --image jupyter/all-spark-notebook:latest
    
  6. Verify the generated Artifact Streaming using the az acr manifest list-referrers command.

    az acr manifest list-referrers --name jupyter/all-spark-notebook:latest
    

Enable Artifact Streaming on AKS

You can enable Artifact Streaming on new or existing node pools in your AKS cluster with ACR integration.

Note

If you don't have a Premium tier ACR integrated with your AKS cluster, you can't use Artifact Streaming on AKS.

Enable Artifact Streaming on a new node pool

Create a new AKS node pool with Artifact Streaming enabled using the az aks nodepool add command with the --enable-artifact-streaming flag.

az aks nodepool add \
    --resource-group myResourceGroup \
    --cluster-name myAKSCluster \
    --name myNodePool \
    --enable-artifact-streaming

Enable Artifact Streaming on an existing node pool

Enable Artifact Streaming on an existing AKS node pool using the az aks nodepool update command with the --enable-artifact-streaming flag.

az aks nodepool update \
    --resource-group myResourceGroup \
    --cluster-name myAKSCluster \
    --name myNodePool \
    --enable-artifact-streaming

Disable Artifact Streaming on an existing node pool

Disable Artifact Streaming on an existing AKS node pool using the az aks nodepool update command with the --disable-artifact-streaming flag.

az aks nodepool update \
    --resource-group myResourceGroup \
    --cluster-name myAKSCluster \
    --name myNodePool \
    --disable-artifact-streaming

Check Artifact Streaming enablement status

Check if Artifact Streaming is enabled on an AKS node pool using the az aks nodepool show command with the --query flag set to artifactStreamingProfile.

az aks nodepool show \
    --resource-group myResourceGroup \
    --cluster-name myAKSCluster \
    --name myNodePool \
    --query artifactStreamingProfile

In the output, check the Enabled field. true means Artifact Streaming is enabled, and false means Artifact Streaming is disabled.

This article describes how to enable and disable Artifact Streaming on your AKS node pools to stream artifacts from ACR and reduce deployment times. To learn more about working with container images in AKS, see Best practices for container image management and security in AKS.