Use Confidential Virtual Machines (CVMs) in Azure Kubernetes Service (AKS) cluster
By: Date: 04/12/2026 Categories: azure Tags: ,

Create an Azure Kubernetes Service (AKS) Cluster with Confidential Virtual Machines (CVMs)

Objective

The objective is to deploy an Azure Kubernetes Service (AKS) cluster using Azure Confidential Virtual Machines (CVMs) to protect sensitive workloads, applications, and data during processing.

Azure Confidential VMs provide hardware-based Trusted Execution Environment (TEE) capabilities, helping protect data in use against unauthorized access from the host operating system, hypervisor, and other privileged infrastructure components.

Target architecture:

    • Azure Kubernetes Service (AKS)
    • Confidential VM-based node pools
    • AMD SEV-SNP-based hardware protection
    • Azure Container Registry (ACR)
    • Azure Key Vault
    • Azure Monitor and Log Analytics
    • Microsoft Entra ID and RBAC
    • Network security and private connectivity

    High-level architecture diagram

    The architecture separates the Azure management plane, Kubernetes control plane, and confidential worker nodes.

    Detailed architecture diagram

    The following diagram shows the recommended production deployment architecture.

    Architecture explanation

    ComponentPurpose
    Azure Application Gateway WAFProtects application entry points
    AKS control planeManages Kubernetes resources
    System node poolRuns cluster infrastructure components
    CVM node poolRuns sensitive application workloads
    AMD SEV-SNPHardware-level memory isolation
    ACRStores application container images
    Key VaultStores application secrets and keys
    Entra IDAuthentication and access management
    Azure MonitorCollects infrastructure and application telemetry
    Azure StorageStores persistent application data

    Important: The AKS control plane is Azure-managed. The confidential VM protection applies to the CVM worker nodes, not automatically to the entire AKS control plane.


    Prerequisites

    1. Azure Account: Subscription with sufficient permissions (e.g., Contributor role).
    2. Azure CLI: Install and update to the latest version (az --version).
    3. Resource Group: Decide on a resource group name and region (ensure the region supports CVMs).
    4. Supported Regions: CVMs are available in select regions (e.g., eastus, westus2, northeurope). Check Azure Regions for availability.
    5. Permissions:
    • Contributor role on the subscription/resource group.
    • Quotas for CVM sizes (e.g., Standard_DC2s_v3).

    Step 1: Install Required Azure CLI Extensions

    Ensure you have the latest AKS extensions:

    az extension update --name aks
    az extension update --name confidentialcompute

    Step 2: Create a Resource Group

    RESOURCE_GROUP="my-aks-cvm-rg"
    LOCATION="eastus"
    
    az group create --name $RESOURCE_GROUP --location $LOCATION

    Step 3: Create an AKS Cluster with CVMs Enabled

    Use the az aks create command with the --enable-confidential-computing flag and specify a CVM-supported VM size (e.g., Standard_DC2s_v3 for AMD SEV).

    Example Command

    CLUSTER_NAME="my-aks-cvm-cluster"
    NODE_COUNT=1
    VM_SIZE="Standard_DC2s_v3"  # CVM-supported VM size
    
    az aks create \
      --resource-group $RESOURCE_GROUP \
      --name $CLUSTER_NAME \
      --location $LOCATION \
      --node-count $NODE_COUNT \
      --node-vm-size $VM_SIZE \
      --enable-confidential-computing \
      --network-plugin azure \
      --docker-bridge-address "172.17.0.1/16" \
      --service-cidr "10.0.0.0/16" \
      --load-balancer-sku standard \
      --enable-addons monitoring

    Key Parameters Explained

    • --enable-confidential-computing: Enables CVMs for worker nodes.
    • --node-vm-size: Must be a CVM-supported size (e.g., Standard_DC2s_v3, Standard_DC4ds_v3, Standard_DC4as_v3).
    • Region: Ensure the location supports CVMs (e.g., eastus, westus2).

    Note: CVMs cannot be added to existing clusters. You must create a new cluster.


    Step 4: Create a CVM Node Pool (Optional but Recommended)

    If you need additional node pools with CVMs, create them explicitly:

    NODE_POOL_NAME="cvm-pool"
    NODE_COUNT_POOL=1
    
    az aks nodepool add \
      --resource-group $RESOURCE_GROUP \
      --cluster-name $CLUSTER_NAME \
      --name $NODE_POOL_NAME \
      --node-count $NODE_COUNT_POOL \
      --node-vm-size $VM_SIZE \
      --enable-confidential-computing \
      --mode "User"  # Or "System" for critical pods

    Step 5: Connect to the Cluster and Verify CVM Nodes

    1. Get Kubernetes Credentials:
       az aks get-credentials --resource-group $RESOURCE_GROUP --name $CLUSTER_NAME
    1. Check Node Status and CVM Attribution:
       kubectl get nodes -o wide

    Look for sev (AMD SEV) or sgx (Intel SGX) in node labels or annotations. You can also check using:

       kubectl describe node <node-name> | grep -i confidential

    Example output snippet:

       Node Options: --secure-boot --sev

    Step 6: Verify CVM Support in Azure Portal

    1. Go to Azure Portal → Kubernetes Services → Select your cluster.
    2. Under Compute, check the Node pools tab. Confirm the VM size ends with _v3 and is labeled as Confidential Compute.

    Additional Considerations

    1. Supported VM Sizes

    Use only CVM-optimized sizes:

    • AMD SEV: Standard_DC2s_v3, Standard_DC4ds_v3, Standard_DC4as_v3.
    • Intel SGX: Standard_TC2 (not yet widely available for AKS).

    2. OS Image

    AKS automatically uses CVM-optimized OS images (e.g., Azure Linux 2 or Ubuntu) when --enable-confidential-computing is set.

    3. Network and Security

    • Disk Encryption: Ensure Azure Disk Encryption is enabled for additional data-at-rest protection.
    • Private Clusters: Use --private-cluster to restrict public endpoint access.
    • Key Management: Use Azure Key Vault for sensitive data (e.g., TLS certificates).

    4. Monitoring and Logging

    • Enable Azure Monitor for containers via:
      az aks enable-addons --addons monitoring --resource-group $RESOURCE_GROUP --name $CLUSTER_NAME

    5. Upgrading Clusters

    • Node Upgrades: Upgrade node pools to newer CVM-supported versions using:
      az aks nodepool upgrade --resource-group $RESOURCE_GROUP --cluster-name $CLUSTER_NAME --name $NODE_POOL_NAME --node-image-version latest

    Troubleshooting

    Common Errors

    1. Unsupported VM Size:
    • Ensure the VM size (Standard_DC2s_v3) is supported in your region.
    • Check with:
      bash az vm list-skus --location eastus --size Standard_DC2s_v3 --output table
    1. “Confidential Compute Not Supported”:
    • Verify your Azure subscription has Quotas for CVM sizes.
    • Confirm the region supports CVMs.
    1. Permission Issues:
    • Grant AKS Cluster Contributor or Contributor role to your user/service principal.

    Compliance and Benefits

    • Compliance: CVMs help meet standards like HIPAA, PCI-DSS, and FedRAMP.
    • Threat Protection: Safeguards against cold-boot attacks, DMA attacks, and hypervisor-level exploits.

    Clean Up

    Delete resources when no longer needed:

    az group delete --name $RESOURCE_GROUP --yes

    By following this guide, you’ll have a secure AKS cluster with Confidential Virtual Machines, leveraging hardware-backed memory encryption for enhanced data protection.

    Reference: Implement Confidential Virtual Machines (CVMs) in Azure Kubernetes Service (AKS)