Skip to content

Commit 72d34e5

Browse files
authored
Merge pull request #2 from meenag16/docs-editor/howto-prepare-cluster-1749580033
add tanzu to prepare your cluster for 2506 (draft)
2 parents 3e9ec76 + 706e871 commit 72d34e5

File tree

1 file changed

+125
-2
lines changed

1 file changed

+125
-2
lines changed

articles/iot-operations/deploy-iot-ops/howto-prepare-cluster.md

Lines changed: 125 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,38 @@ To prepare an Azure Arc-enabled Kubernetes cluster, you need:
7373

7474
* [Azure IoT Operations supported environments](./overview-deploy.md#supported-environments).
7575
* [Azure Arc-enabled Kubernetes system requirements](/azure/azure-arc/kubernetes/system-requirements).
76+
77+
### [Tanzu Kubernetes Grid with a Management Cluster](#tab/tkgm)
7678

79+
To prepare a TKGm workload cluster, you need:
80+
81+
- An Azure subscription with either the Owner role or a combination of Contributor and User Access Administrator roles. You can check your access level by navigating to your subscription, selecting Access control (IAM) on the left-hand side of the Azure portal, and then selecting View my access. If you don't have an Azure subscription, [create one for free](https://azure.microsoft.com/free/?WT.mc_id=A261C142F) before you begin.
82+
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+
85+
86+
```azurecli
87+
az group create --location <REGION> --resource-group <RESOURCE_GROUP> --subscription <SUBSCRIPTION_ID>
88+
```
89+
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+
92+
- The latest version of the **connectedk8s** extension for Azure CLI:
93+
94+
95+
```bash
96+
az extension add --upgrade --name connectedk8s
97+
```
98+
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)
100+
101+
- Hardware that meets the system requirements:
102+
103+
- [Azure IoT Operations supported environments](./overview-deploy.md#supported-environments).
104+
- [Azure Arc-enabled Kubernetes system requirements](/azure/azure-arc/kubernetes/system-requirements).
105+
106+
- [TKGm requirements.](https://techdocs.broadcom.com/us/en/vmware-tanzu/standalone-components/tanzu-kubernetes-grid/2-5/tkg/mgmt-reqs-index.html)
107+
77108
---
78109

79110
## Create and Arc-enable a cluster
@@ -238,9 +269,101 @@ By default, a Kubernetes cluster is created with a node pool that can run Linux
238269

239270
Then, once you have an Azure Arc-enabled Kubernetes cluster, you can [deploy Azure IoT Operations](howto-deploy-iot-operations.md).
240271

241-
---
272+
### [Tanzu Kubernetes Grid with a Management Cluster](#tab/tkgm)
273+
274+
To prepare a TKGm workload cluster:
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).
277+
278+
1. SSH to one of the control plane VMs that is created. Once on the control plane VM, run the following:
279+
280+
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+
```
287+
288+
### Arc-enable your cluster
289+
290+
Connect your cluster to Azure Arc so that it can be managed remotely.
291+
292+
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+
294+
295+
```azurecli
296+
az login
297+
```
298+
299+
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+
301+
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.
302+
303+
1. Register the required resource providers in your subscription.
304+
305+
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+
```
314+
315+
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.
316+
317+
318+
```azurecli
319+
az connectedk8s connect --name <CLUSTER_NAME> -l <REGION> --resource-group <RESOURCE_GROUP> --subscription <SUBSCRIPTION_ID> --enable-oidc-issuer --enable-workload-identity --disable-auto-upgrade
320+
```
321+
322+
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+
324+
1. Get the cluster's issuer URL.
325+
326+
327+
```azurecli
328+
az connectedk8s show --resource-group <RESOURCE_GROUP> --name <CLUSTER_NAME> --query oidcIssuerProfile.issuerUrl --output tsv
329+
```
330+
331+
Save the output of this command to use in the next steps.
332+
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+
335+
336+
```azurecli
337+
kubectl edit cluster <CLUSTER_NAME>
338+
```
339+
340+
1. Add the following content to the `config.yaml` file, replacing the <OIDC_ISSUER_URL> placeholder with your cluster's issuer URL.
341+
342+
343+
```yaml
344+
- name: apiServerExtraArgs
345+
value: {"service-account-issuer":"<OIDC_ISSUER_URL>"}
346+
```
347+
348+
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:
349+
350+
Azure CLIEdit development language
351+
352+
353+
```azurecli
354+
az connectedk8s enable-features -n <CLUSTER_NAME> -g <RESOURCE_GROUP> --custom-locations-oid $OBJECT_ID --features cluster-connect custom-locations
355+
```
356+
357+
### Update Pod Security Admission Settings
358+
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`.
360+
361+
362+
```azurecli
363+
kubectl apply -f <link to repo>
364+
```
242365

243-
## Advanced configuration
366+
## Advanced Configuration
244367

245368
At this point, when you have an Azure Arc-enabled Kubernetes cluster but before you deploy Azure IoT Operations to it, you might want to configure your cluster for advanced scenarios.
246369

0 commit comments

Comments
 (0)