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/databox-online/azure-stack-edge-gpu-deploy-arc-kubernetes-cluster.md
+68-36Lines changed: 68 additions & 36 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,7 +6,7 @@ author: alkohli
6
6
7
7
ms.service: azure-stack-edge
8
8
ms.topic: how-to
9
-
ms.date: 02/17/2022
9
+
ms.date: 03/14/2025
10
10
ms.author: alkohli
11
11
---
12
12
@@ -16,9 +16,9 @@ ms.author: alkohli
16
16
17
17
This article shows you how to enable Azure Arc on an existing Kubernetes cluster on your Azure Stack Edge Pro device.
18
18
19
-
This procedure assumes that you have read and understood the following articles:
19
+
This procedure assumes that you've read and understood the following articles:
20
20
21
-
-[Kubernetes workloads on Azure Stack Edge Pro device](azure-stack-edge-gpu-kubernetes-workload-management.md)
21
+
-[Kubernetes workloads on Azure Stack Edge Pro device](azure-stack-edge-gpu-kubernetes-workload-management.md).
22
22
-[What is Azure Arc-enabled Kubernetes (Preview)?](/azure/azure-arc/kubernetes/overview)
23
23
24
24
## Prerequisites
@@ -31,7 +31,7 @@ Make sure that you've completed the following prerequisites on your Azure Stack
31
31
1. The device is activated. See [Activate the device](azure-stack-edge-gpu-deploy-activate.md).
32
32
1. The device has the compute role configured via Azure portal and has a Kubernetes cluster. See [Configure compute](azure-stack-edge-gpu-deploy-configure-compute.md).
33
33
34
-
1. You've owner access to the subscription. You would need this access during the role assignment step for your service principal.
34
+
1. You have owner access to the subscription. You would need this access during the role assignment step for your service principal.
35
35
36
36
37
37
### For client accessing the device
@@ -50,7 +50,7 @@ Make sure that you've completed the following prerequisites on your Azure Stack
50
50
- Use `kubectl version` to check the version of kubectl running on the client. Make a note of the full version.
51
51
- In the local UI of your Azure Stack Edge Pro device, go to **Software update** and note the Kubernetes server version number.
52
52
53
-

53
+

54
54
55
55
- Verify these two versions are compatible.
56
56
@@ -62,27 +62,27 @@ Before you enable Azure Arc on the Kubernetes cluster, you need to enable and re
62
62
1. To enable a resource provider, in the Azure portal, go to the subscription that you're planning to use for the deployment. Go to **Resource Providers**.
63
63
1. In the right-pane, search for the providers you want to add. In this example, `Microsoft.Kubernetes` and `Microsoft.KubernetesConfiguration`.

74
74
75
75
You can also register resource providers via the `az cli`. For more information, see [Register the two providers for Azure Arc-enabled Kubernetes](/azure/azure-arc/kubernetes/quickstart-connect-cluster#register-providers-for-azure-arc-enabled-kubernetes).
76
76
77
77
## Create service principal, assign role
78
78
79
79
1. Make sure that you have `Subscription ID` and the name of the resource group you used for the resource deployment for your Azure Stack Edge service. To get the subscription ID, go to your Azure Stack Edge resource in the Azure portal. Navigate to **Overview > Essentials**.

82
82
83
83
To get the resource group name, go to **Properties**.
84
84
85
-

85
+

86
86
87
87
1. To create a service principal, use the following command via the `az cli`.
88
88
@@ -104,9 +104,39 @@ You can also register resource providers via the `az cli`. For more information,
104
104
PS /home/user>
105
105
```
106
106
107
-
1. Make a note of the `appID`, `name`, `password`, and `tenantID` as you'll use these values as input to the next command.
107
+
1. Make a note of the `appId`, `name`, `password`, and `tenantID` as you'll use these values as input to the next command.
108
108
109
-
1. After creating the new service principal, assign the `Kubernetes Cluster - Azure Arc Onboarding` role to the newly created principal. This is a built-in Azure role (use the role ID in the command) with limited permissions. Use the following command:
109
+
There are several ways to obtain `appId`. The following three options are the preferred methods. If you use one of the following options, you can skip steps 1, 2, and 3 from the previous section and move directly to the following step 4.
110
+
111
+
- Option 1 - Use Minishell to run the following PowerShell cmdlet:
- Option 2 - Use the following steps to view JSON details for your device In Azure portal:
120
+
121
+
1. Navigate to your Azure Stack Edge device **Overview** and then select **JSON view** at top right.
122
+
123
+

124
+
125
+
1. In the **Resource JSON** details for your device, make note of the `principalId`.
126
+
127
+

128
+
129
+
- Option 3 - Use non-Azure Stack Edge PowerShell on a client machine to run the following command:
130
+
131
+
```powershell
132
+
// ASE resource group and resource name can be obtained from Azure portal
1. After you create the new service principal, or after you retrieve it using one of these options, assign the `Kubernetes Cluster - Azure Arc Onboarding` role to the newly created principal. This is a built-in Azure role (use the role ID in the command) with limited permissions. Use the following command:
110
140
111
141
`az role assignment create --role 34e09817-6cbe-4d01-b1a2-e0eac5743d41 --assignee <appId-from-service-principal> --scope /subscriptions/<SubscriptionID>/resourceGroups/<Resource-group-name>`
112
142
@@ -128,45 +158,47 @@ You can also register resource providers via the `az cli`. For more information,
128
158
PS /home/user>
129
159
```
130
160
131
-
132
161
## Enable Arc on Kubernetes cluster
133
162
134
163
Follow these steps to configure the Kubernetes cluster for Azure Arc management:
135
164
136
165
1. [Connect to the PowerShell interface](azure-stack-edge-gpu-connect-powershell-interface.md#connect-to-the-powershell-interface) of your device.
137
166
138
-
1. Type:
167
+
1. Run the following command:
139
168
140
169
`Set-HcsKubernetesAzureArcAgent -SubscriptionId "<Your Azure Subscription Id>" -ResourceGroupName "<Resource Group Name>" -ResourceName "<Azure Arc resource name (shouldn't exist already)>" -Location "<Region associated with resource group>" -TenantId "<Tenant Id of service principal>" -ClientId "<App id of service principal>"`
141
170
142
-
When this command is run, there's a follow-up prompt to enter the `ClientSecret`. Provide the service principal password.
171
+
After you run this command, you see a follow-up prompt to specify `ClientSecret`. Provide the service principal password at the prompt.
143
172
144
173
Add the `CloudEnvironment` parameter if you're using a cloud other than Azure public. You can set this parameter to `AZUREPUBLICCLOUD`, `AZURECHINACLOUD`, `AZUREGERMANCLOUD`, and `AZUREUSGOVERNMENTCLOUD`.
145
174
146
-
> [!NOTE]
147
-
> - To deploy Azure Arc on your device, make sure that you are using a [Supported region for Azure Arc](https://azure.microsoft.com/global-infrastructure/services/?products=azure-arc).
148
-
> - Use the `az account list-locations` command to figure out the exact location name to pass in the `Set-HcsKubernetesAzureArcAgent` cmdlet. Location names are typically formatted without any spaces.
149
-
> - `ClientId` and `ClientSecret` are required.
175
+
**Usage considerations:**
150
176
151
-
Here's an example:
177
+
- To deploy Azure Arc on your device, make sure that you're using a [Supported region for Azure Arc](https://azure.microsoft.com/global-infrastructure/services/?products=azure-arc).
178
+
- Use the `az account list-locations` command to determine the exact location name to pass in the `Set-HcsKubernetesAzureArcAgent` cmdlet. Location names are typically formatted without any spaces.
179
+
180
+
> [!IMPORTANT]
181
+
> If you obtain the `Id` instead of creating a new service principle using the older method, then do not specify `ClientId`, `TenantId`, or `ClientSecret`.
cmdlet Set-HcsKubernetesAzureArcAgent at command pipeline position 1
188
+
WARNING: A script or application on the remote computer 10.126.76.0 is sending a prompt request. When you are prompted,
189
+
enter sensitive information, such as credentials or passwords, only if you trust the remote computer and the
190
+
application or script that is requesting the data.
161
191
162
-
Supply values for the following parameters:
163
-
ClientSecret: **********************************
164
-
[10.100.10.10]: PS>
165
-
```
192
+
cmdlet Set-HcsKubernetesAzureArcAgent at command pipeline position 1
193
+
194
+
Supply values for the following parameters:
195
+
ClientSecret: **********************************
196
+
[10.100.10.10]: PS>
197
+
```
166
198
167
-
In the Azure portal, a resource should be created with the name you provided in the preceding command.
199
+
In the Azure portal, a resource should be created with the name you provided in the preceding command.
168
200
169
-

201
+

170
202
171
203
1. To verify that Azure Arc is enabled successfully, run the following command from PowerShell interface:
172
204
@@ -208,16 +240,16 @@ A conceptual overview of these agents is available [here](/azure/azure-arc/kuber
208
240
209
241
To remove the Azure Arc management, follow these steps:
210
242
211
-
1. 1. [Connect to the PowerShell interface](azure-stack-edge-gpu-connect-powershell-interface.md#connect-to-the-powershell-interface) of your device.
212
-
2. Type:
243
+
1. [Connect to the PowerShell interface](azure-stack-edge-gpu-connect-powershell-interface.md#connect-to-the-powershell-interface) of your device.
244
+
2. Run the following command:
213
245
214
246
`Remove-HcsKubernetesAzureArcAgent`
215
247
216
248
217
249
> [!NOTE]
218
-
> By default, when resource `yamls` are deleted from the Git repository, the corresponding resources are not deleted from the Kubernetes cluster. You need to set `--sync-garbage-collection` in Arc OperatorParams to allow the deletion of resources when deleted from git repository. For more information, see [Delete a configuration](/azure/azure-arc/kubernetes/tutorial-use-gitops-connected-cluster#additional-parameters)
250
+
> By default, when resource `yamls` are deleted from the Git repository, the corresponding resources aren't deleted from the Kubernetes cluster. You need to set `--sync-garbage-collection` in Arc OperatorParams to allow the deletion of resources when deleted from git repository. For more information, see [Delete a configuration](/azure/azure-arc/kubernetes/tutorial-use-gitops-connected-cluster#additional-parameters)
219
251
220
252
## Next steps
221
253
222
254
To understand how to run an Azure Arc deployment, see
223
-
[Deploy a stateless PHP `Guestbook` application with Redis via GitOps on an Azure Stack Edge Pro device](azure-stack-edge-gpu-deploy-stateless-application-git-ops-guestbook.md)
255
+
[Deploy a stateless PHP `Guestbook` application with Redis via GitOps on an Azure Stack Edge Pro device](azure-stack-edge-gpu-deploy-stateless-application-git-ops-guestbook.md).
0 commit comments