Skip to content

Commit 715ef8e

Browse files
Merge pull request #227082 from jiaochenlu/update-230102
Update Kubernetes changes
2 parents 4356177 + d1d2af1 commit 715ef8e

File tree

7 files changed

+316
-120
lines changed

7 files changed

+316
-120
lines changed

articles/machine-learning/how-to-attach-kubernetes-to-workspace.md

Lines changed: 43 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -16,30 +16,57 @@ ms.custom: build-spring-2022, cliv2, sdkv2, event-tier1-build-2022
1616

1717
Once AzureML extension is deployed on AKS or Arc Kubernetes cluster, you can attach the Kubernetes cluster to AzureML workspace and create compute targets for ML professionals to use.
1818

19-
Some key considerations when attaching Kubernetes cluster to AzureML workspace:
20-
* If you need to access Azure resource securely from your training script, you can specify a [managed identity](./how-to-identity-based-service-authentication.md) for Kubernetes compute target during attach operation.
21-
* If you plan to have different compute target for different project/team, you can specify Kubernetes namespace for the compute target to isolate workload among different teams/projects.
22-
* For the same Kubernetes cluster, you can attach it to the same workspace multiple times and create multiple compute targets for different project/team/workload.
19+
## Prerequisites
20+
21+
Attaching a Kubernetes cluster to AzureML workspace can flexibly support many different scenarios, such as the shared scenarios with multiple attachments, model training scripts accessing Azure resources, and the authentication configuration of the workspace. But you need to pay attention to the following prerequisites.
22+
23+
#### Multi-attach and workload isolation
24+
25+
**One cluster to one workspace, creating multiple compute targets**
26+
* For the same Kubernetes cluster, you can attach it to the same workspace multiple times and create multiple compute targets for different projects/teams/workloads.
27+
28+
**One cluster to multiple workspaces**
2329
* For the same Kubernetes cluster, you can also attach it to multiple workspaces, and the multiple workspaces can share the same Kubernetes cluster.
2430

25-
### Prerequisite
2631

27-
Azure Machine Learning workspace defaults to having a system-assigned managed identity to access Azure ML resources. The steps are completed if the system assigned default setting is on.
32+
If you plan to have different compute targets for different projects/teams, you can specify the existed **Kubernetes namespace** in your cluster for the compute target to **isolate workload** among different teams/projects.
33+
34+
> [!IMPORTANT]
35+
>
36+
> The namespace you plan to specify when attaching the cluster to AzureML workspace should be previously created in your cluster.
37+
38+
#### Securely access Azure resource from training script
2839

40+
If you need to access Azure resource securely from your training script, you can specify a [managed identity](./how-to-identity-based-service-authentication.md) for Kubernetes compute target during attach operation.
2941

30-
Otherwise, if a user-assigned managed identity is specified in Azure Machine Learning workspace creation, the following role assignments need to be granted to the managed identity manually before attaching the compute.
42+
#### Attach to workspace with user-assigned managed identity
3143

32-
|Azure resource name |Role to be assigned|Description|
44+
Azure Machine Learning workspace defaults to having a system-assigned managed identity to access Azure ML resources. The steps are completed if the system assigned default setting is on.
45+
46+
Otherwise, if a [user-assigned managed identity is specified in Azure Machine Learning workspace creation](../machine-learning/how-to-identity-based-service-authentication.md#user-assigned-managed-identity), the following role assignments need to be granted to the managed identity manually before attaching the compute.
47+
48+
|Azure resource name |Roles to be assigned|Description|
3349
|--|--|--|
3450
|Azure Relay|Azure Relay Owner|Only applicable for Arc-enabled Kubernetes cluster. Azure Relay isn't created for AKS cluster without Arc connected.|
35-
|Kubernetes - Azure Arc or Azure Kubernetes Service|Reader|Applicable for both Arc-enabled Kubernetes cluster and AKS cluster.|
51+
|Kubernetes - Azure Arc or Azure Kubernetes Service|Reader <br> Kubernetes Extension Contributor <br> Azure Kubernetes Service Cluster Admin |Applicable for both Arc-enabled Kubernetes cluster and AKS cluster.|
3652

37-
Azure Relay resource is created during the extension deployment under the same Resource Group as the Arc-enabled Kubernetes cluster.
3853

54+
> [!TIP]
55+
>
56+
> Azure Relay resource is created during the extension deployment under the same Resource Group as the Arc-enabled Kubernetes cluster.
57+
58+
> [!NOTE]
59+
>
60+
> * If the "Kubernetes Extension Contributor" role permission is not available, the cluster attachment fails with "extension not installed" error.
61+
> * If the "Azure Kubernetes Service Cluster Admin" role permission is not available, the cluster attachment fails with "internal server" error.
62+
63+
## How to attach a Kubernetes cluster to AzureML workspace
64+
65+
We support two ways to attach a Kubernetes cluster to AzureML workspace, using Azure CLI or studio UI.
3966

4067
### [Azure CLI](#tab/cli)
4168

42-
[!INCLUDE [cli v2](../../includes/machine-learning-cli-v2.md)]
69+
[!INCLUDE [CLI v2](../../includes/machine-learning-CLI-v2.md)]
4370

4471
The following commands show how to attach an AKS and Azure Arc-enabled Kubernetes cluster, and use it as a compute target with managed identity enabled.
4572

@@ -58,6 +85,7 @@ az ml compute attach --resource-group <resource-group-name> --workspace-name <wo
5885
Set the `--type` argument to `Kubernetes`. Use the `identity_type` argument to enable `SystemAssigned` or `UserAssigned` managed identities.
5986

6087
> [!IMPORTANT]
88+
>
6189
> `--user-assigned-identities` is only required for `UserAssigned` managed identities. Although you can provide a list of comma-separated user managed identities, only the first one is used when you attach your cluster.
6290
>
6391
> Compute attach won't create the Kubernetes namespace automatically or validate whether the kubernetes namespace existed. You need to verify that the specified namespace exists in your cluster, otherwise, any AzureML workloads submitted to this compute will fail.
@@ -98,7 +126,7 @@ To access Azure Container Registry (ACR) for a Docker image, and a Storage Accou
98126
### Assign managed identity
99127
- You can assign a managed identity to the compute in the compute attach step.
100128
- If the compute has already been attached, you can update the settings to use a managed identity in Azure Machine Learning studio.
101-
- Go to [Azure Machine Learning studio](https://ml.azure.com). Select __Compute__, __Attached compute__, and select your attached compute.
129+
- Go to [Azure Machine Learning studio](https://ml.azure.com). Select **Compute**, **Attached compute**, and select your attached compute.
102130
- Select the pencil icon to edit managed identity.
103131

104132
:::image type="content" source="media/how-to-attach-kubernetes-to-workspace/edit-identity.png" alt-text="Screenshot of updating identity of the Kubernetes compute from Azure portal.":::
@@ -117,11 +145,11 @@ If you are using the Azure portal to assign roles and have a **system-assigned m
117145

118146
If you have user-assigned managed identity, select **Managed identity** to find the target identity.
119147

120-
You can use Managed Identity to pull images from Azure Container Registry. Grant the __AcrPull__ role to the compute Managed Identity. For more information, see [Azure Container Registry roles and permissions](../container-registry/container-registry-roles.md).
148+
You can use Managed Identity to pull images from Azure Container Registry. Grant the **AcrPull** role to the compute Managed Identity. For more information, see [Azure Container Registry roles and permissions](../container-registry/container-registry-roles.md).
121149

122150
You can use a managed identity to access Azure Blob:
123-
- For read-only purpose, __Storage Blob Data Reader__ role should be granted to the compute managed identity.
124-
- For read-write purpose, __Storage Blob Data Contributor__ role should be granted to the compute managed identity.
151+
- For read-only purpose, **Storage Blob Data Reader** role should be granted to the compute managed identity.
152+
- For read-write purpose, **Storage Blob Data Contributor** role should be granted to the compute managed identity.
125153

126154
## Next steps
127155

articles/machine-learning/how-to-deploy-kubernetes-extension.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,20 +32,20 @@ In this article, you can learn:
3232
* Or an Arc Kubernetes cluster is up and running. Follow instructions in [connect existing Kubernetes cluster to Azure Arc](../azure-arc/kubernetes/quickstart-connect-cluster.md).
3333
* If the cluster is an Azure RedHat OpenShift Service (ARO) cluster or OpenShift Container Platform (OCP) cluster, you must satisfy other prerequisite steps as documented in the [Reference for configuring Kubernetes cluster](./reference-kubernetes.md#prerequisites-for-aro-or-ocp-clusters) article.
3434
* For production purposes, the Kubernetes cluster must have a minimum of **4 vCPU cores and 14-GB memory**. For more information on resource detail and cluster size recommendations, see [Recommended resource planning](./reference-kubernetes.md).
35-
* Cluster running behind an outbound proxy server or firewall needs extra [network configurations](./how-to-access-azureml-behind-firewall.md).
35+
* Cluster running behind an **outbound proxy server** or **firewall** needs extra [network configurations](./how-to-access-azureml-behind-firewall.md#scenario-use-kubernetes-compute).
3636
* Install or upgrade Azure CLI to version 2.24.0 or higher.
3737
* Install or upgrade Azure CLI extension `k8s-extension` to version 1.2.3 or higher.
3838

3939

4040
## Limitations
4141

4242
- [Using a service principal with AKS](../aks/kubernetes-service-principal.md) is **not supported** by Azure Machine Learning. The AKS cluster must use a **managed identity** instead. Both **system-assigned managed identity** and **user-assigned managed identity** are supported. For more information, see [Use a managed identity in Azure Kubernetes Service](../aks/use-managed-identity.md).
43+
- When your AKS cluster used service principal is converted to use Managed Identity, before installing the extension, all node pools need to be deleted and recreated, rather than updated directly.
4344
- [Disabling local accounts](../aks/managed-aad.md#disable-local-accounts) for AKS is **not supported** by Azure Machine Learning. When the AKS Cluster is deployed, local accounts are enabled by default.
4445
- If your AKS cluster has an [Authorized IP range enabled to access the API server](../aks/api-server-authorized-ip-ranges.md), enable the AzureML control plane IP ranges for the AKS cluster. The AzureML control plane is deployed across paired regions. Without access to the API server, the machine learning pods can't be deployed. Use the [IP ranges](https://www.microsoft.com/download/confirmation.aspx?id=56519) for both the [paired regions](../availability-zones/cross-region-replication-azure.md) when enabling the IP ranges in an AKS cluster.
46+
- Azure Machine Learning does not support attaching an AKS cluster cross subscription. If you have an AKS cluster in a different subscription, you must first [connect it to Azure-Arc](../azure-arc/kubernetes/quickstart-connect-cluster.md) and specify in the same subscription as your Azure Machine Learning workspace.
4547
- Azure Machine Learning does not guarantee support for all preview stage features in AKS. For example, [Azure AD pod identity](../aks/use-azure-ad-pod-identity.md) is not supported.
4648
- If you've previously followed the steps from [AzureML AKS v1 document](./v1/how-to-create-attach-kubernetes.md) to create or attach your AKS as inference cluster, use the following link to [clean up the legacy azureml-fe related resources](./v1/how-to-create-attach-kubernetes.md#delete-azureml-fe-related-resources) before you continue the next step.
47-
- We currently don't support attaching your AKS cluster across subscription, which means that your AKS cluster must be in the same subscription as your workspace.
48-
- The workaround to meet your cross-subscription requirement is to first connect AKS to Azure-ARC and then attach this ARC-Kubernetes resource.
4949

5050

5151
## Review AzureML extension configuration settings

0 commit comments

Comments
 (0)