You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
#CustomerIntent: As an IT professional, I want prepare an Azure-Arc enabled Kubernetes cluster so that I can deploy Azure IoT Operations to it.
12
12
---
@@ -26,22 +26,91 @@ An Azure Arc-enabled Kubernetes cluster is a prerequisite for deploying Azure Io
26
26
27
27
To prepare your Azure Arc-enabled Kubernetes cluster, you need:
28
28
29
-
- An Azure subscription. If you don't have an Azure subscription, create a [free account](https://azure.microsoft.com/free/?WT.mc_id=A261C142F) before you begin.
30
-
-[Azure CLI version 2.46.0 or newer installed](/cli/azure/install-azure-cli) on your development machine.
31
29
- Hardware that meets the [system requirements](../../azure-arc/kubernetes/system-requirements.md).
* An Azure subscription. If you don't have an Azure subscription, [create one for free](https://azure.microsoft.com/free/?WT.mc_id=A261C142F) before you begin.
34
+
35
+
* Azure CLI version 2.46.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](/cli/azure/install-azure-cli).
36
+
37
+
* The Azure IoT Operations extension for Azure CLI. Use the following command to add the extension or update it to the latest version:
38
+
39
+
```bash
40
+
az extension add --upgrade --name azure-iot-ops
41
+
```
42
+
43
+
* Hardware that meets the system requirements:
44
+
45
+
* Ensure that your machine has a minimum of 10-GB RAM, 4 vCPUs, and 40-GB free disk space.
46
+
* Review the [AKS Edge Essentials requirements and support matrix](/azure/aks/hybrid/aks-edge-system-requirements).
47
+
* Review the [AKS Edge Essentials networking guidance](/azure/aks/hybrid/aks-edge-concept-networking).
48
+
49
+
50
+
### [Ubuntu](#tab/ubuntu)
51
+
52
+
* An Azure subscription. If you don't have an Azure subscription, [create one for free](https://azure.microsoft.com/free/?WT.mc_id=A261C142F) before you begin.
53
+
54
+
* Azure CLI version 2.46.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](/cli/azure/install-azure-cli).
55
+
56
+
* The Azure IoT Operations extension for Azure CLI. Use the following command to add the extension or update it to the latest version:
57
+
58
+
```bash
59
+
az extension add --upgrade --name azure-iot-ops
60
+
```
61
+
62
+
* Review the [K3s requirements](https://docs.k3s.io/installation/requirements).
63
+
64
+
Azure IoT Operations also works on Ubuntu in Windows Subsystem for Linux (WSL) on your Windows machine. Use WSL for testing and development purposes only.
65
+
66
+
To set up your WSL Ubuntu environment:
67
+
68
+
1.[Install Linux on Windows with WSL](/windows/wsl/install).
69
+
70
+
1. Enable `systemd`:
71
+
72
+
```bash
73
+
sudo -e /etc/wsl.conf
74
+
```
75
+
76
+
Add the following to _wsl.conf_ and then save the file:
77
+
78
+
```text
79
+
[boot]
80
+
systemd=true
81
+
```
82
+
83
+
1. After you enable`systemd`, [re-enable running windows executables from WSL](https://github.com/microsoft/WSL/issues/8843):
84
+
85
+
```bash
86
+
sudo sh -c 'echo :WSLInterop:M::MZ::/init:PF > /usr/lib/binfmt.d/WSLInterop.conf'
87
+
sudo systemctl unmask systemd-binfmt.service
88
+
sudo systemctl restart systemd-binfmt
89
+
sudo systemctl mask systemd-binfmt.service
90
+
```
91
+
92
+
### [Codespaces](#tab/codespaces)
93
+
94
+
* An Azure subscription. If you don't have an Azure subscription, [create one for free](https://azure.microsoft.com/free/?WT.mc_id=A261C142F) before you begin.
95
+
96
+
* A [GitHub](https://github.com) account.
97
+
98
+
* Visual Studio Code installed on your development machine. For more information, see [Download Visual Studio Code](https://code.visualstudio.com/download).
99
+
100
+
---
101
+
102
+
## Create a cluster
34
103
35
104
This section provides steps to prepare and Arc-enable clusters in validated environments on Linux and Windows as well as GitHub Codespaces in the cloud.
[Azure Kubernetes Service Edge Essentials](/azure/aks/hybrid/aks-edge-overview) is an on-premises Kubernetes implementation of Azure Kubernetes Service (AKS) that automates running containerized applications at scale. AKS Edge Essentials includes a Microsoft-supported Kubernetes platform that includes a lightweight Kubernetes distribution with a small footprint and simple installation experience, making it easy for you to deploy Kubernetes on PC-class or "light" edge hardware.
40
109
41
110
>[!TIP]
42
111
>You can use the [AksEdgeQuickStartForAio.ps1](https://github.com/Azure/AKS-Edge/blob/main/tools/scripts/AksEdgeQuickStart/AksEdgeQuickStartForAio.ps1) script to automate the steps in this section and connect your cluster.
43
112
>
44
-
>In an elevated PowerShell window, run the following commands:
113
+
>Open an elevated PowerShell window, change the directory to a working folder, then run the following commands:
Run the following commands to check that the deployment was successful:
79
148
80
-
To connect your cluster to Azure Arc, complete the steps in [Connect your AKS Edge Essentials cluster to Arc](/azure/aks/hybrid/aks-edge-howto-connect-to-arc).
149
+
```powershell
150
+
Import-Module AksEdge
151
+
Get-AksEdgeDeploymentInfo
152
+
```
81
153
82
-
# [Ubuntu](#tab/ubuntu)
154
+
In the output of the `Get-AksEdgeDeploymentInfo` command, you should see that the cluster's Arc status is `Connected`.
Azure IoT Operations should work on any CNCF-conformant kubernetes cluster. For Ubuntu Linux, Microsoft currently supports K3s clusters.
159
+
160
+
> [!IMPORTANT]
161
+
> If you're using Ubuntu in Windows Subsystem for Linux (WSL), run all of these steps in your WSL environment, including the Azure CLI steps for configuring your cluster.
162
+
163
+
To prepare a K3s Kubernetes cluster on Ubuntu:
164
+
165
+
1. Run the K3s installation script:
166
+
167
+
```bash
168
+
curl -sfL https://get.k3s.io | sh -
169
+
```
170
+
171
+
For full installation information, see the [K3s quick-start guide](https://docs.k3s.io/quick-start).
You can run Ubuntu in Windows Subsystem for Linux (WSL) on your Windows machine. Use WSL for testing and development purposes only.
214
+
To connect your cluster to Azure Arc, complete the steps in [Connect your AKS Edge Essentials cluster to Arc](/azure/aks/hybrid/aks-edge-howto-connect-to-arc).
101
215
102
-
> [!IMPORTANT]
103
-
> Run all of these steps in your WSL environment, including the Azure CLI steps for configuring your cluster.
216
+
### [Ubuntu](#tab/ubuntu)
104
217
105
-
To set up your WSL Ubuntu environment:
218
+
To connect your cluster to Azure Arc:
106
219
107
-
1. [Install Linux on Windows with WSL](/windows/wsl/install).
220
+
1. On the machine where you deployed the Kubernetes cluster, or in your WSL environment, sign in with Azure CLI:
108
221
109
-
1. Enable `systemd`:
222
+
```azurecli
223
+
az login
224
+
```
110
225
111
-
```bash
112
-
sudo -e /etc/wsl.conf
113
-
```
226
+
1. Set environment variables for your Azure subscription, location, a new resource group, and the cluster name as it will show up in your resource group.
114
227
115
-
Add the following to _wsl.conf_ and then save the file:
228
+
```bash
229
+
# Id of the subscription where your resource group and Arc-enabled cluster will be created
230
+
export SUBSCRIPTION_ID=<SUBSCRIPTION_ID>
116
231
117
-
```text
118
-
[boot]
119
-
systemd=true
120
-
```
232
+
# Azure region where the created resource group will be located
233
+
# Currently supported regions: "eastus", "eastus2", "westus", "westus2", "westus3", "westeurope", or "northeurope"
234
+
export LOCATION=<REGION>
121
235
122
-
1. After you enable `systemd`, [re-enable running windows executables from WSL](https://github.com/microsoft/WSL/issues/8843):
236
+
# Name of a new resource group to create which will hold the Arc-enabled cluster and Azure IoT Operations resources
237
+
export RESOURCE_GROUP=<NEW_RESOURCE_GROUP_NAME>
123
238
124
-
```bash
125
-
sudo sh -c 'echo :WSLInterop:M::MZ::/init:PF > /usr/lib/binfmt.d/WSLInterop.conf'
126
-
sudo systemctl unmask systemd-binfmt.service
127
-
sudo systemctl restart systemd-binfmt
128
-
sudo systemctl mask systemd-binfmt.service
129
-
```
239
+
# Name of the Arc-enabled cluster to create in your resource group
1. Set the Azure subscription context for all commands:
132
244
133
-
## Arc-enable your cluster
245
+
```azurecli
246
+
az account set -s $SUBSCRIPTION_ID
247
+
```
248
+
249
+
1. Register the required resource providers in your subscription:
250
+
251
+
>[!NOTE]
252
+
>This step only needs to be run once per subscription.
253
+
254
+
```azurecli
255
+
az provider register -n "Microsoft.ExtendedLocation"
256
+
az provider register -n "Microsoft.Kubernetes"
257
+
az provider register -n "Microsoft.KubernetesConfiguration"
258
+
az provider register -n "Microsoft.IoTOperationsOrchestrator"
259
+
az provider register -n "Microsoft.IoTOperationsMQ"
260
+
az provider register -n "Microsoft.IoTOperationsDataProcessor"
261
+
az provider register -n "Microsoft.DeviceRegistry"
262
+
```
263
+
264
+
1. Use the [az group create](/cli/azure/group#az-group-create) command to create a resource group in your Azure subscription to store all the resources:
265
+
266
+
```azurecli
267
+
az group create --location $LOCATION --resource-group $RESOURCE_GROUP --subscription $SUBSCRIPTION_ID
268
+
```
269
+
270
+
1. Use the [az connectedk8s connect](/cli/azure/connectedk8s#az-connectedk8s-connect) command to Arc-enable your Kubernetes cluster and manage it as part of your Azure resource group:
1. Get the `objectId` of the Microsoft Entra ID application that the Azure Arc service uses and save it as an environment variable.
277
+
278
+
```azurecli
279
+
export OBJECT_ID=$(az ad sp show --id bc313c14-388c-4e7d-a58e-70017303ee3b --query id -o tsv)
280
+
```
281
+
282
+
1. Use the [az connectedk8s enable-features](/cli/azure/connectedk8s#az-connectedk8s-enable-features) command to enable custom location support on your cluster. This command uses the `objectId` of the Microsoft Entra ID application that the Azure Arc service uses. Run this command on the machine where you deployed the Kubernetes cluster:
To verify that your cluster is ready for Azure IoT Operations deployment, you can use the [verify-host](/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.
297
+
298
+
```azurecli
299
+
az iot ops verify-host
300
+
```
301
+
141
302
To verify that your Kubernetes cluster is now Azure Arc-enabled, run the following command:
To verify that your cluster is ready for Azure IoT Operations deployment, you can use the [verify-host](/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.
178
-
179
-
```azurecli
180
-
az iot ops verify-host
181
-
```
182
-
183
338
## Create sites
184
339
185
340
To manage which clusters your OT users have access to, you can group your clusters into sites. To learn more, see [What is Azure Arc site manager (preview)?](../../azure-arc/site-manager/overview.md).
0 commit comments