Skip to content

Commit 662774f

Browse files
committed
New RP provider; fix include; add object_id tip
1 parent ef9fd79 commit 662774f

File tree

5 files changed

+84
-92
lines changed

5 files changed

+84
-92
lines changed

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

Lines changed: 80 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,86 @@ To connect your cluster to Azure Arc:
225225
export CLUSTER_NAME=<NEW_CLUSTER_NAME>
226226
```
227227
228-
[!INCLUDE [connect-cluster-k3s](../includes/connect-cluster-k3s.md)]
228+
1. After signing in, 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.
229+
230+
1. Register the required resource providers in your subscription:
231+
232+
>[!NOTE]
233+
>This step only needs to be run once per subscription. To register resource providers, you need permission to do the `/register/action` operation, which is included in subscription Contributor and Owner roles. For more information, see [Azure resource providers and types](../../azure-resource-manager/management/resource-providers-and-types.md).
234+
235+
```azurecli
236+
az provider register -n "Microsoft.ExtendedLocation"
237+
az provider register -n "Microsoft.Kubernetes"
238+
az provider register -n "Microsoft.KubernetesConfiguration"
239+
az provider register -n "Microsoft.IoTOperations"
240+
az provider register -n "Microsoft.DeviceRegistry"
241+
az provider register -n "Microsoft.SecretSyncController"
242+
```
243+
244+
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:
245+
246+
```azurecli
247+
az group create --location $LOCATION --resource-group $RESOURCE_GROUP --subscription $SUBSCRIPTION_ID
248+
```
249+
1. Remove the existing connected k8s cli if any
250+
```azurecli
251+
az extension remove --name connectedk8s
252+
```
253+
254+
1. Download and install a preview version of the `connectedk8s` extension for Azure CLI.
255+
256+
```azurecli
257+
curl -L -o connectedk8s-1.10.0-py2.py3-none-any.whl https://github.com/AzureArcForKubernetes/azure-cli-extensions/raw/refs/heads/connectedk8s/public/cli-extensions/connectedk8s-1.10.0-py2.py3-none-any.whl
258+
az extension add --upgrade --source connectedk8s-1.10.0-py2.py3-none-any.whl
259+
```
260+
261+
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:
262+
263+
```azurecli
264+
az connectedk8s connect --name $CLUSTER_NAME -l $LOCATION --resource-group $RESOURCE_GROUP --subscription $SUBSCRIPTION_ID --enable-oidc-issuer --enable-workload-identity
265+
```
266+
267+
1. Get the cluster's issuer URL.
268+
269+
```azurecli
270+
az connectedk8s show --resource-group $RESOURCE_GROUP --name $CLUSTER_NAME --query oidcIssuerProfile.issuerUrl --output tsv
271+
```
272+
273+
Save the output of this command to use in the next steps.
274+
275+
1. Create a k3s config file.
276+
277+
```bash
278+
sudo nano /etc/rancher/k3s/config.yaml
279+
```
280+
281+
1. Add the following content to the `config.yaml` file, replacing the `<SERVICE_ACCOUNT_ISSUER>` placeholder with your cluster's issuer URL.
282+
283+
```yml
284+
kube-apiserver-arg:
285+
- service-account-issuer=<SERVICE_ACCOUNT_ISSUER>
286+
- service-account-max-token-expiration=24h
287+
```
288+
289+
1. Save the file and exit the nano editor.
290+
291+
1. Get the `objectId` of the Microsoft Entra ID application that the Azure Arc service uses in your tenant and save it as an environment variable. Run the following command exactly as written, without changing the GUID value.
292+
293+
```azurecli
294+
export OBJECT_ID=$(az ad sp show --id bc313c14-388c-4e7d-a58e-70017303ee3b --query id -o tsv)
295+
```
296+
297+
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:
298+
299+
```azurecli
300+
az connectedk8s enable-features -n $CLUSTER_NAME -g $RESOURCE_GROUP --custom-locations-oid $OBJECT_ID --features cluster-connect custom-locations
301+
```
302+
303+
1. Restart K3s.
304+
305+
```bash
306+
systemctl restart k3s
307+
```
229308
230309
---
231310

articles/iot-operations/get-started-end-to-end-sample/quickstart-deploy.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ To connect your cluster to Azure Arc:
8888
az provider register -n "Microsoft.KubernetesConfiguration"
8989
az provider register -n "Microsoft.IoTOperations"
9090
az provider register -n "Microsoft.DeviceRegistry"
91+
az provider register -n "Microsoft.SecretSyncController"
9192
```
9293

9394
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:
@@ -105,7 +106,7 @@ To connect your cluster to Azure Arc:
105106
>[!TIP]
106107
>The value of `$CLUSTER_NAME` is automatically set to the name of your codespace. Replace the environment variable if you want to use a different name.
107108
108-
1. Get the `objectId` of the Microsoft Entra ID application that the Azure Arc service in your tenant uses and save it as an environment variable.
109+
1. Get the `objectId` of the Microsoft Entra ID application that the Azure Arc service in your tenant uses and save it as an environment variable. Run the following command exactly as written, without changing the GUID value.
109110

110111
```azurecli
111112
export OBJECT_ID=$(az ad sp show --id bc313c14-388c-4e7d-a58e-70017303ee3b --query id -o tsv)

articles/iot-operations/includes/connect-cluster-k3s.md

Lines changed: 0 additions & 90 deletions
This file was deleted.

articles/iot-operations/manage-layered-network/howto-configure-l3-cluster-layered-network.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,7 @@ login.microsoftonline.com. 0 IN A 100.104.0.165
245245
az provider register -n "Microsoft.KubernetesConfiguration"
246246
az provider register -n "Microsoft.IoTOperations"
247247
az provider register -n "Microsoft.DeviceRegistry"
248+
az provider register -n "Microsoft.SecretSyncController"
248249
```
249250
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:
250251
```bash

articles/iot-operations/manage-layered-network/howto-configure-l4-cluster-layered-network.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,7 @@ The following steps for setting up [AKS Edge Essentials](/azure/aks/hybrid/aks-e
155155
az provider register -n "Microsoft.KubernetesConfiguration"
156156
az provider register -n "Microsoft.IoTOperations"
157157
az provider register -n "Microsoft.DeviceRegistry"
158+
az provider register -n "Microsoft.SecretSyncController"
158159
```
159160
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:
160161
```bash

0 commit comments

Comments
 (0)