|
| 1 | +--- |
| 2 | +title: AIO with AKS Edge Essentials |
| 3 | +description: Learn how to use Azure IoT Operations with AKS Edge Essentials. |
| 4 | +author: rcheeran |
| 5 | +ms.author: rcheeran |
| 6 | +ms.topic: how-to |
| 7 | +ms.date: 10/21/2024 |
| 8 | +ms.custom: template-how-to |
| 9 | +--- |
| 10 | + |
| 11 | +# Deploy Azure IoT Operations on AKS Edge Essentials |
| 12 | + |
| 13 | +[Azure IoT Operations (AIO)]() requires an Arc-enabled Kubernetes cluster. You can use AKS Edge Essentials to create a Microsoft managed Kubernetes cluster and deploy AIO as a workload on it. This article describes the steps to run a handy script that creates an AKS Edge Essentials Kubernetes clusters with all the required configurations applicable for AIO. |
| 14 | + |
| 15 | +> [!INFO] |
| 16 | +> AIO is Gnerally Available on AKS EE single machine clusters. Deploying clusters on multiple machines is an experimental feature. |
| 17 | +
|
| 18 | +## Pre-requisites for running the script |
| 19 | + |
| 20 | +- An Azure subscription. If you don't have an Azure subscription, create one for free before you begin. |
| 21 | +- Azure CLI version 2.64.0 or newer installed on your development machine. Use az --version to check your version and az upgrade to update if necessary.For more information, see [How to install the Azure CLI](https://review.learn.microsoft.com/en-us/cli/azure/install-azure-cli). |
| 22 | +- The latest version of the following extensions for Azure CLI: |
| 23 | + ```bash |
| 24 | + az extension add --upgrade --name azure-iot-ops |
| 25 | + az extension add --upgrade --name connectedk8s |
| 26 | + ``` |
| 27 | +- Hardware requirements: Ensure that your machine has a minimum of 16-GB available RAM, 8 available vCPUs, and 52-GB free disk space reserved for Azure IoT Operations. |
| 28 | +- If you're going to deploy Azure IoT Operations to a multi-node cluster with fault tolerance enabled, review the hardware and storage requirements in [Prepare Linux for Edge Volumes](https://review.learn.microsoft.com/en-us/azure/azure-arc/container-storage/prepare-linux-edge-volumes). |
| 29 | +
|
| 30 | +
|
| 31 | +## Create an AKS EE cluster for AIO |
| 32 | +The [AksEdgeQuickStartForAio.ps1](https://github.com/Azure/AKS-Edge/blob/main/tools/scripts/AksEdgeQuickStart/AksEdgeQuickStartForAio.ps1) script automates the process of creating and connecting a cluster, and is the recommended path for deploying Azure IoT Operations on AKS Edge Essentials. |
| 33 | +1. Open an elevated PowerShell window and change the directory to a working folder. |
| 34 | +1. Get the objectId of the Microsoft Entra ID application that the Azure Arc service uses in your tenant. Run the following command exactly as written, without changing the GUID value. |
| 35 | + ```azurecli |
| 36 | + az ad sp show --id bc313c14-388c-4e7d-a58e-70017303ee3b --query id -o tsv |
| 37 | + ``` |
| 38 | +1. Run the following commands, replacing the placeholder values with your information: |
| 39 | +
|
| 40 | +|Placeholder|Value | |
| 41 | +|---------|---------| |
| 42 | +|SUBSCRIPTION_ID | The ID of your Azure subscription. If you don't know your subscription ID, see [Find your Azure subscription](https://review.learn.microsoft.com/en-us/azure/azure-portal/get-subscription-tenant-id#find-your-azure-subscription). | |
| 43 | +|TENANT_ID | The ID of your Microsoft Entra tenant. If you don't know your tenant ID, see [Find your Microsoft Entra tenant](https://review.learn.microsoft.com/en-us/azure/azure-portal/get-subscription-tenant-id#find-your-microsoft-entra-tenant). | |
| 44 | +|RESOURCE_GROUP_NAME | The name of an existing resource group or a name for a new resource group to be created. | |
| 45 | +|LOCATION | An Azure region close to you. For the list of currently supported Azure regions, see [Supported regions](https://review.learn.microsoft.com/en-us/azure/iot-operations/overview-iot-operations#supported-regions). | |
| 46 | +|CLUSTER_NAME | A name for the new cluster to be created. | |
| 47 | +|ARC_APP_OBJECT_ID | The object ID value that you retrieved in the previous step. | |
| 48 | +
|
| 49 | +```powershell |
| 50 | +$url = "https://raw.githubusercontent.com/Azure/AKS-Edge/main/tools/scripts/AksEdgeQuickStart/AksEdgeQuickStartForAio.ps1" |
| 51 | +Invoke-WebRequest -Uri $url -OutFile .\AksEdgeQuickStartForAio.ps1 |
| 52 | +Unblock-File .\AksEdgeQuickStartForAio.ps1 |
| 53 | +Set-ExecutionPolicy -ExecutionPolicy Bypass -Scope Process -Force |
| 54 | +.\AksEdgeQuickStartForAio.ps1 -SubscriptionId "<SUBSCRIPTION_ID>" -TenantId "<TENANT_ID>" -ResourceGroupName "<RESOURCE_GROUP_NAME>" -Location "<LOCATION>" -ClusterName "<CLUSTER_NAME>" -CustomLocationOid "<ARC_APP_OBJECT_ID>" |
| 55 | +``` |
| 56 | +If there are any issues during deployment, including if your machine reboots as part of this process, run the whole set of commands again. |
| 57 | +1. Run the following commands to check that the deployment was successful: |
| 58 | +```powershell |
| 59 | +Import-Module AksEdge |
| 60 | +Get-AksEdgeDeploymentInfo |
| 61 | +``` |
| 62 | +In the output of the Get-AksEdgeDeploymentInfo command, you should see that the cluster's Arc status is Connected. |
| 63 | + |
| 64 | +## Verify your cluster |
| 65 | +To verify that your cluster is ready for Azure IoT Operations deployment, you can use the [verify-host](https://review.learn.microsoft.com/en-us/cli/azure/iot/ops#az-iot-ops-verify-host) helper command in the Azure IoT Operations extension for Azure CLI. When run on the cluster host, this helper command checks connectivity to Azure Resource Manager and Microsoft Container Registry endpoints. |
| 66 | +```azurecli |
| 67 | +az iot ops verify-host |
| 68 | +``` |
| 69 | + |
| 70 | +To verify that your Kubernetes cluster is Azure Arc-enabled, run the following command: |
| 71 | +```bash |
| 72 | +kubectl get deployments,pods -n azure-arc |
| 73 | +``` |
| 74 | + |
| 75 | +The output looks like the following example: |
| 76 | +```output |
| 77 | +NAME READY UP-TO-DATE AVAILABLE AGE |
| 78 | +deployment.apps/clusterconnect-agent 1/1 1 1 10m |
| 79 | +deployment.apps/extension-manager 1/1 1 1 10m |
| 80 | +deployment.apps/clusteridentityoperator 1/1 1 1 10m |
| 81 | +deployment.apps/controller-manager 1/1 1 1 10m |
| 82 | +deployment.apps/flux-logs-agent 1/1 1 1 10m |
| 83 | +deployment.apps/cluster-metadata-operator 1/1 1 1 10m |
| 84 | +deployment.apps/extension-events-collector 1/1 1 1 10m |
| 85 | +deployment.apps/config-agent 1/1 1 1 10m |
| 86 | +deployment.apps/kube-aad-proxy 1/1 1 1 10m |
| 87 | +deployment.apps/resource-sync-agent 1/1 1 1 10m |
| 88 | +deployment.apps/metrics-agent 1/1 1 1 10m |
| 89 | +
|
| 90 | +NAME READY STATUS RESTARTS AGE |
| 91 | +pod/clusterconnect-agent-5948cdfb4c-vzfst 3/3 Running 0 10m |
| 92 | +pod/extension-manager-65b8f7f4cb-tp7pp 3/3 Running 0 10m |
| 93 | +pod/clusteridentityoperator-6d64fdb886-p5m25 2/2 Running 0 10m |
| 94 | +pod/controller-manager-567c9647db-qkprs 2/2 Running 0 10m |
| 95 | +pod/flux-logs-agent-7bf6f4bf8c-mr5df 1/1 Running 0 10m |
| 96 | +pod/cluster-metadata-operator-7cc4c554d4-nck9z 2/2 Running 0 10m |
| 97 | +pod/extension-events-collector-58dfb78cb5-vxbzq 2/2 Running 0 10m |
| 98 | +pod/config-agent-7579f558d9-5jnwq 2/2 Running 0 10m |
| 99 | +pod/kube-aad-proxy-56d9f754d8-9gthm 2/2 Running 0 10m |
| 100 | +pod/resource-sync-agent-769bb66b79-z9n46 2/2 Running 0 10m |
| 101 | +pod/metrics-agent-6588f97dc-455j8 2/2 Running 0 10m |
| 102 | +``` |
| 103 | + |
| 104 | +## Next steps |
| 105 | + |
| 106 | +- [Deploy Azure IoT Operations](https://review.learn.microsoft.com/en-us/azure/iot-operations/deploy-iot-ops/howto-deploy-iot-operations) |
| 107 | +- [Uninstall AKS cluster](aks-edge-howto-uninstall.md) |
0 commit comments