Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Note
Azure Linux with OS Guard (preview) is being replaced by Azure Container Linux (ACL).
Azure Container Linux is the long‑term, immutable, container‑optimized Linux operating system (OS) for Azure Kubernetes Service (AKS). It provides a secure, minimal, and operationally consistent host OS designed to run containerized workloads at scale.
For more information, see the Azure Container Linux (ACL) overview.
In this tutorial, part one of five, you learn how to:
- Install the Kubernetes CLI,
kubectl. - Install the
aks-previewAzure CLI extension. - Register the
AzureLinuxOSGuardPreviewfeature flag. - Create an Azure resource group.
- Create and deploy an Azure Linux with OS Guard cluster.
- Configure
kubectlto connect to your Azure Linux with OS Guard cluster.
In later tutorials, you learn how to add an Azure Linux with OS Guard node pool to an existing cluster and migrate existing nodes to Azure Linux with OS Guard.
Prerequisites
- You need the latest version of Azure CLI. Use the
az versioncommand to find the version. To upgrade to the latest version, use theaz upgradecommand. - Install the
aks-previewAzure CLI extension. - Register the
AzureLinuxOSGuardPreviewfeature flag.
Azure Linux with OS Guard considerations and limitations
Before you begin, review the following considerations and limitations for Azure Linux with OS Guard (preview):
- Kubernetes version 1.32.0 or higher is required for Azure Linux with OS Guard.
- All Azure Linux with OS Guard images have Federal Information Process Standard (FIPS) and Trusted Launch enabled.
- Azure CLI and ARM templates are the only supported deployment methods for Azure Linux with OS Guard on AKS in preview. PowerShell and Terraform aren't supported.
- Arm64 images aren't supported with Azure Linux with OS Guard on AKS in preview.
NodeImageandNoneare the only supported operating system (OS) upgrade channels for Azure Linux with OS Guard on AKS.UnmanagedandSecurityPatchare incompatible with Azure Linux with OS Guard due to the immutable /usr directory.- Artifact Streaming isn't supported.
- Pod Sandboxing isn't supported.
- Confidential Virtual Machines (CVMs) aren't supported.
- Gen 1 virtual machines (VMs) aren't supported.
Install the aks-preview Azure CLI extension
Important
AKS preview features are available on a self-service, opt-in basis. Previews are provided "as is" and "as available," and they're excluded from the service-level agreements and limited warranty. AKS previews are partially covered by customer support on a best-effort basis. As such, these features aren't meant for production use. For more information, see the following support articles:
Install the aks-preview extension using the az extension add command.
az extension add --name aks-preview
Update to the latest version of the extension using the az extension update command.
az extension update --name aks-preview
Register the AzureLinuxOSGuardPreview feature flag
Register the
AzureLinuxOSGuardPreviewfeature flag using theaz feature registercommand.az feature register --namespace "Microsoft.ContainerService" --name "AzureLinuxOSGuardPreview"It takes a few minutes for the status to show Registered.
Verify the registration status using the
az feature showcommand.az feature show --namespace "Microsoft.ContainerService" --name "AzureLinuxOSGuardPreview"When the status reflects Registered, refresh the registration of the
Microsoft.ContainerServiceresource provider using theaz provider registercommand.az provider register --namespace "Microsoft.ContainerService"
Set environment variables
Set the following environment variables to create unique resource names for each deployment:
export RESOURCE_GROUP="<your-resource-group-name>"
export REGION="<your-region>"
export CLUSTER_NAME="<your-cluster-name>"
Create a resource group
When creating a resource group in Azure, you're required to specify a location. This location is the storage location of your resource group metadata and where your resources run in Azure if you don't specify another region when creating a resource.
Create a resource group using the az group create command.
az group create --name $RESOURCE_GROUP --location $REGION
Example output:
{
"id": "/subscriptions/xxxxx/resourceGroups/testAzureLinuxOSGuardResourceGroupxxxxx",
"location": "EastUS2",
"managedBy": null,
"name": "testAzureLinuxOSGuardResourceGroupxxxxx",
"properties": {
"provisioningState": "Succeeded"
},
"tags": null,
"type": "Microsoft.Resources/resourceGroups"
}
Create an Azure Linux with OS Guard (preview) cluster
Create an AKS cluster using the az aks create command with the --os-sku AzureLinuxOSGuard parameter to provision an Azure Linux with OS Guard cluster. Enabling FIPS, secure boot, and vtpm is required to use Azure Linux with OS Guard.
az aks create --name $CLUSTER_NAME --resource-group $RESOURCE_GROUP --os-sku AzureLinuxOSGuard --node-osdisk-type Managed --enable-fips-image --enable-secure-boot --enable-vtpm
Example output:
{
"id": "/subscriptions/xxxxx/resourceGroups/testAzureLinuxOSGuardResourceGroupxxxxx/providers/Microsoft.ContainerService/managedClusters/testAzureLinuxOSGuardClusterxxxxx",
"location": "WestUS2",
"name": "testAzureLinuxOSGuardClusterxxxxx",
"properties": {
"provisioningState": "Succeeded"
},
"type": "Microsoft.ContainerService/managedClusters"
}
After a few minutes, the command completes and returns JSON-formatted information about the cluster.
Connect to the cluster using kubectl
Configure
kubectlto connect to your Kubernetes cluster using theaz aks get-credentialscommand.az aks get-credentials --resource-group $RESOURCE_GROUP --name $CLUSTER_NAMEVerify the connection to your cluster using the
kubectl get nodescommand to return a list of the cluster nodes.kubectl get nodesExample output:
NAME STATUS ROLES AGE VERSION aks-nodepool1-00000000-0 Ready agent 10m v1.20.7 aks-nodepool1-00000000-1 Ready agent 10m v1.20.7
Next step
In this tutorial, you created and deployed an Azure Linux with OS Guard cluster. In the next tutorial, you learn how to add an Azure Linux with OS Guard node pool to an existing cluster.