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/machine-learning/how-to-create-attach-kubernetes.md
+58-21Lines changed: 58 additions & 21 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,8 +7,8 @@ ms.service: machine-learning
7
7
ms.subservice: core
8
8
ms.topic: how-to
9
9
ms.custom: devx-track-azurecli
10
-
ms.author: jordane
11
-
author: jpe316
10
+
ms.author: ssambare
11
+
author: shivanissambare
12
12
ms.reviewer: larryfr
13
13
ms.date: 11/05/2021
14
14
---
@@ -330,28 +330,59 @@ Following example shows how to enable TLS termination with custom certificate an
330
330
> For more information about how to secure model deployment on AKS cluster, please see [use TLS to secure a web service through Azure Machine Learning](how-to-secure-web-service.md)
331
331
332
332
## Create or attach an AKS cluster to use Internal Load Balancer with private IP
333
+
333
334
When you create or attach an AKS cluster, you can configure the cluster to use an Internal Load Balancer. With an Internal Load Balancer, scoring endpoints for your deployments to AKS will use a private IP within the virtual network. Following code snippets show how to configure an Internal Load Balancer for an AKS cluster.
335
+
336
+
# [Create](#tab/akscreate)
337
+
338
+
To create an AKS cluster that uses an Internal Load Balancer, use the the `load_balancer_type` and `load_balancer_subnet` parameters:
339
+
334
340
```python
335
-
336
-
from azureml.core.compute.aks import AksUpdateConfiguration
337
-
from azureml.core.compute import AksCompute, ComputeTarget
338
-
339
-
# When you create an AKS cluster, you can specify Internal Load Balancer to be created with provisioning_config object
To attach an AKS cluster and use an internal load balancer (no public IP for the cluster), use the `load_balancer_type` and `load_balancer_subnet` parameters:
361
+
362
+
```python
363
+
from azureml.core.compute import AksCompute, ComputeTarget
364
+
# Set the resource group that contains the AKS cluster and the cluster name
365
+
resource_group ='myresourcegroup'
366
+
cluster_name ='myexistingcluster'
367
+
# Change to the name of the subnet that contains AKS
368
+
subnet_name ="default"
369
+
370
+
# Attach the cluster to your workgroup. If the cluster has less than 12 virtual CPUs, use the following instead:
> If your AKS cluster is configured with an Internal Load Balancer, using a Microsoft provided certificate is not supported and you must use [custom certificate to enable TLS](how-to-secure-web-service.md#deploy-on-azure-kubernetes-service).
When trying to create or attach an AKS cluster, you may receive a message that the request has been denied because "Load Balancers should not have public IPs". This message is returned when an administrator has applied a policy that prevents using an AKS cluster with a public IP address.
501
+
502
+
To resolve this problem, create/attach the cluster by using the `load_balancer_type` and `load_balancer_subnet` parameters. For more information, see [Internal Load Balancer (private IP)](#create-or-attach-an-aks-cluster-to-use-internal-load-balancer-with-private-ip).
503
+
467
504
## Next steps
468
505
469
506
*[Use Azure RBAC for Kubernetes authorization](../aks/manage-azure-rbac.md)
@@ -245,26 +245,9 @@ For more information, see the [az ml computetarget create aks](/cli/azure/ml(v1)
245
245
246
246
---
247
247
248
-
When __attaching an existing cluster__ to your workspace, you must wait until after the attach operation to configure the load balancer. For information on attaching a cluster, see [Attach an existing AKS cluster](how-to-create-attach-kubernetes.md).
248
+
When __attaching an existing cluster__ to your workspace, use the `load_balancer_type` and `load_balancer_subnet` parameters of [AksCompute.attach_configuration()](/python/api/azureml-core/azureml.core.compute.aks.akscompute#azureml-core-compute-aks-akscompute-attach-configuration) to configure the load balancer.
249
249
250
-
After attaching the existing cluster, you can then update the cluster to use an internal load balancer/private IP:
251
-
252
-
```python
253
-
import azureml.core
254
-
from azureml.core.compute.aks import AksUpdateConfiguration
255
-
from azureml.core.compute import AksCompute
256
-
257
-
# ws = workspace object. Creation not shown in this snippet
258
-
aks_target = AksCompute(ws,"myaks")
259
-
260
-
# Change to the name of the subnet that contains AKS
261
-
subnet_name ="default"
262
-
# Update AKS configuration to use an internal load balancer
0 commit comments