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
Copy file name to clipboardExpand all lines: articles/iot-operations/deploy-iot-ops/howto-prepare-cluster.md
+56-59Lines changed: 56 additions & 59 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -83,22 +83,22 @@ To prepare a Tanzu Kubernetes Grid (TKG) workload cluster, you need:
83
83
- An Azure resource group. Only one Azure IoT Operations instance is supported per resource group. To create a new resource group, use the [az group create](/cli/azure/group#az-group-create) command. For the list of currently supported Azure regions, see [Supported regions](../overview-iot-operations.md#supported-regions).
84
84
85
85
86
-
```azurecli
87
-
az group create --location <REGION> --resource-group <RESOURCE_GROUP> --subscription <SUBSCRIPTION_ID>
88
-
```
86
+
```azurecli
87
+
az group create --location <REGION> --resource-group <RESOURCE_GROUP> --subscription <SUBSCRIPTION_ID>
88
+
```
89
89
90
90
- Azure CLI version 2.53.0 or newer installed on your cluster 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).
91
91
92
92
- The latest version of the **connectedk8s** extension for Azure CLI:
93
93
94
94
95
-
```bash
96
-
az extension add --upgrade --name connectedk8s
97
-
```
95
+
```bash
96
+
az extension add --upgrade --name connectedk8s
97
+
```
98
98
99
99
-[Tanzu Kubernetes Grid with a standalone management cluster.](https://techdocs.broadcom.com/us/en/vmware-tanzu/standalone-components/tanzu-kubernetes-grid/2-5/tkg/mgmt-index.html)
-[Azure Arc-enabled Kubernetes system requirements](/azure/azure-arc/kubernetes/system-requirements).
@@ -159,13 +159,13 @@ To prepare a K3s Kubernetes cluster on Ubuntu:
159
159
160
160
Connect your cluster to Azure Arc so that it can be managed remotely.
161
161
162
-
1.On the machine where you deployed the Kubernetes cluster, sign into Azure CLI with your Microsoft Entra user account that has the required role(s) for the Azure subscription:
162
+
1.From a machine that has `kubectl` access to your cluster, sign into Azure CLI with your Microsoft Entra user account that has the required role(s) for the Azure subscription:
163
163
164
-
```azurecli
164
+
```azurecli
165
165
az login
166
166
```
167
167
168
-
If at any point you get an error that says *Your device is required to be managed to access your resource*, run `az login` again and make sure that you sign in interactively with a browser.
168
+
If at any point you get an error that says *Your device is required to be managed to access your resource*, run `az login` again and make sure that you sign in interactively with a browser.
169
169
170
170
1. After you sign in, the Azure CLI displays all of your subscriptions and indicates your default subscription with an asterisk `*`. To continue with your default subscription, select `Enter`. Otherwise, type the number of the Azure subscription that you want to use.
171
171
@@ -271,19 +271,18 @@ Then, once you have an Azure Arc-enabled Kubernetes cluster, you can [deploy Azu
271
271
272
272
### [Tanzu Kubernetes Grid with a management cluster](#tab/tkgm)
273
273
274
-
To prepare a TKGm workload cluster:
274
+
To prepare a TKGm workload cluster, you need:
275
275
276
-
1. Create a single-node or multi-node TKGm workload cluster. For guidance, see the [Tanzu documentation](https://techdocs.broadcom.com/us/en/vmware-tanzu/standalone-components/tanzu-kubernetes-grid/2-5/tkg/workload-clusters-index.html).
276
+
- A single-node or multi-node TKGm workload cluster. For guidance, see the [Tanzu documentation](https://techdocs.broadcom.com/us/en/vmware-tanzu/standalone-components/tanzu-kubernetes-grid/2-5/tkg/workload-clusters-index.html).
277
277
278
-
1. SSH to one of the control plane VMs that is created. Once on the control plane VM, run the following:
278
+
### Update pod security admission settings
279
+
280
+
Before deploying Azure IoT Operations, you will need to update the Pod Security Admission settings on your TKGm cluster. Applying this file will pre-create namespace labels and set pod security to `privileged`.
279
281
280
282
281
-
```bash
282
-
mkdir ~/.kube
283
-
sudo cp /etc/kubernetes/admin.conf ~/.kube/config
284
-
sudo chown <user>:<group>~/.kube/config
285
-
kubectl get pods -A
286
-
```
283
+
```azurecli
284
+
kubectl apply -f <link to repo>
285
+
```
287
286
288
287
### Arc-enable your cluster
289
288
@@ -292,9 +291,9 @@ Connect your cluster to Azure Arc so that it can be managed remotely.
292
291
1. On the machine where you deployed the Kubernetes cluster, sign into Azure CLI with your Microsoft Entra user account that has the required role(s) for the Azure subscription:
293
292
294
293
295
-
```azurecli
296
-
az login
297
-
```
294
+
```azurecli
295
+
az login
296
+
```
298
297
299
298
If at any point you get an error that says *Your device is required to be managed to access your resource*, run `az login` again and make sure that you sign in interactively with a browser.
300
299
@@ -303,65 +302,63 @@ If at any point you get an error that says *Your device is required to be manage
303
302
1. Register the required resource providers in your subscription.
304
303
305
304
306
-
```azurecli
307
-
az provider register -n "Microsoft.ExtendedLocation"
308
-
az provider register -n "Microsoft.Kubernetes"
309
-
az provider register -n "Microsoft.KubernetesConfiguration"
310
-
az provider register -n "Microsoft.IoTOperations"
311
-
az provider register -n "Microsoft.DeviceRegistry"
312
-
az provider register -n "Microsoft.SecretSyncController"
313
-
```
305
+
```azurecli
306
+
az provider register -n "Microsoft.ExtendedLocation"
307
+
az provider register -n "Microsoft.Kubernetes"
308
+
az provider register -n "Microsoft.KubernetesConfiguration"
309
+
az provider register -n "Microsoft.IoTOperations"
310
+
az provider register -n "Microsoft.DeviceRegistry"
311
+
az provider register -n "Microsoft.SecretSyncController"
312
+
```
314
313
315
314
1. Use the [az connectedk8s connect](/cli/azure/connectedk8s) command to Arc-enable your Kubernetes cluster and manage it as part of your Azure resource group.
To prevent unplanned updates to Azure Arc and the system Arc extensions that Azure IoT Operations uses as dependencies, this command disables autoupgrade. Instead, [manually upgrade agents](/azure/azure-arc/kubernetes/agent-upgrade) as needed.
323
322
324
323
1. Get the cluster's issuer URL.
325
324
326
325
327
-
```azurecli
328
-
az connectedk8s show --resource-group <RESOURCE_GROUP> --name <CLUSTER_NAME> --query oidcIssuerProfile.issuerUrl --output tsv
329
-
```
326
+
```azurecli
327
+
az connectedk8s show --resource-group <RESOURCE_GROUP> --name <CLUSTER_NAME> --query oidcIssuerProfile.issuerUrl --output tsv
328
+
```
330
329
331
330
Save the output of this command to use in the next steps.
332
331
333
-
1. SSH to a TKGm management cluster. Edit the custom resource for the workload cluster with the issuer URL from the previous step.
334
-
332
+
1. Connect to the TKG management cluster. Edit the custom resource for the workload cluster with the issuer URL from the previous step.
335
333
336
-
```azurecli
337
-
kubectl edit cluster <CLUSTER_NAME>
338
-
```
334
+
```azurecli
335
+
kubectl edit cluster <CLUSTER_NAME>
336
+
```
339
337
340
338
1. Add the following content to the `config.yaml` file, replacing the <OIDC_ISSUER_URL> placeholder with your cluster's issuer URL.
339
+
> [!NOTE]
340
+
> The URL should be copied exactly as printed by the prior command, including any characters such as `/`.
1. Prepare for enabling the Azure Arc service, custom location, on your Arc cluster by getting the custom location object ID and saving it as the environment variable, OBJECT_ID. You must be logged into Azure CLI with a Microsoft Entra user account to successfully run the command, not a service principal. Run the following command **exactly as written**, without changing the GUID value.
1. Use the [az connectedk8s enable-features](/cli/azure/connectedk8s) command to enable the custom location feature on your Arc cluster. This command uses the OBJECT_ID environment variable saved from the previous step to set the value for the custom-locations-oid parameter. Run this command on the machine where you deployed the Kubernetes cluster:
export OBJECT_ID=$(az ad sp show --id bc313c14-388c-4e7d-a58e-70017303ee3b --query id -o tsv)
350
+
```
356
351
357
-
### Update pod security admission settings
352
+
> [!NOTE]
353
+
>If you receive the error: "Unable to fetch oid of 'custom-locations' app. Proceeding without enabling the feature. Insufficient privileges to complete the operation," then your service principal might lack the necessary permissions to retrieve the object ID of the custom location. Log into Azure CLI with a Microsoft Entra user account that meets the prerequisites. For more information, see [Create and manage custom locations](https://aka.ms/enable-cl-sp).
358
354
359
-
Before deploying Azure IoT Operations, you will need to update the Pod Security Admission settings on your TKGm cluster. Applying this file will pre-create namespace labels and set pod security to `privileged`.
355
+
1. Use the [az connectedk8s enable-features](/cli/azure/connectedk8s) command to enable the custom location feature on your Arc cluster. This command uses the OBJECT_ID environment variable saved from the previous step to set the value for the custom-locations-oid parameter. Run this command on the machine where you deployed the Kubernetes cluster:
0 commit comments