Skip to content

Commit 7f38428

Browse files
committed
Update k8s compute TSG and log info
1 parent c9e9b33 commit 7f38428

File tree

1 file changed

+179
-0
lines changed

1 file changed

+179
-0
lines changed

articles/machine-learning/reference-kubernetes.md

Lines changed: 179 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -242,6 +242,185 @@ According to your scheduling requirements of the Azureml-dedicated nodes, you ca
242242
- `amlarc workspace (has this <compute X>)` taint
243243
- `amlarc <compute X>` taint
244244

245+
246+
## Integrate other load balancers with AzureML extension over HTTP or HTTPS
247+
248+
In addition to the default AzureML inference load balancer [azureml-fe](../machine-learning/how-to-kubernetes-inference-routing-azureml-fe.md), you can also integrate other load balancers with AzureML extension over HTTP or HTTPS.
249+
250+
This tutorial helps illustrate how to integrate the [Nginx Ingress Controller](https://github.com/kubernetes/ingress-nginx) or the [Azure Application Gateway](../application-gateway/overview.md).
251+
252+
### Prerequisites
253+
254+
- [Deploy the AzureML extension](../machine-learning/how-to-deploy-kubernetes-extension.md) with `inferenceRouterServiceType=ClusterIP` and `allowInsecureConnections=True`, so that the Nginx Ingress Conroller can handle TLS termination by itself instead of handing it over to [azureml-fe](../machine-learning/how-to-kubernetes-inference-routing-azureml-fe.md) when service is exposed over HTTPS.
255+
- For integrating with **Nginx Ingress Controller**, you will need a Kubernetes cluster setup with Nginx Ingress Controller.
256+
- [**Create a basic controller**](../aks/ingress-basic.md): If you are starting from scratch, refer to these instructions.
257+
- For integrating with **Azure Application Gateway**, you will need a Kubernetes cluster setup with Azure Application Gateway Ingress Controller.
258+
- [**Greenfield Deployment**](../application-gateway/tutorial-ingress-controller-add-on-new.md): If you are starting from scratch, refer to these instructions.
259+
- [**Brownfield Deployment**](../application-gateway/tutorial-ingress-controller-add-on-existing.md): If you have an existing AKS cluster and Application Gateway, refer to these instructions.
260+
- If you want to use HTTPS on this application, you will need a x509 certificate and its private key.
261+
262+
### Expose services over HTTP
263+
264+
In order to expose the azureml-fe we will using the following ingress resource:
265+
266+
```yaml
267+
# Nginx Ingress Controller example
268+
apiVersion: networking.k8s.io/v1
269+
kind: Ingress
270+
metadata:
271+
name: azureml-fe
272+
namespace: azureml
273+
spec:
274+
ingressClassName: nginx
275+
rules:
276+
- http:
277+
paths:
278+
- path: /
279+
backend:
280+
service:
281+
name: azureml-fe
282+
port:
283+
number: 80
284+
pathType: Prefix
285+
```
286+
This ingress will expose the `azureml-fe` service and the selected deployment as a default backend of the Nginx Ingress Controller.
287+
288+
289+
290+
```yaml
291+
# Azure Application Gateway example
292+
apiVersion: networking.k8s.io/v1
293+
kind: Ingress
294+
metadata:
295+
name: azureml-fe
296+
namespace: azureml
297+
spec:
298+
ingressClassName: azure-application-gateway
299+
rules:
300+
- http:
301+
paths:
302+
- path: /
303+
backend:
304+
service:
305+
name: azureml-fe
306+
port:
307+
number: 80
308+
pathType: Prefix
309+
```
310+
This ingress will expose the `azureml-fe` service and the selected deployment as a default backend of the Application Gateway.
311+
312+
Save the above ingress resource as `ing-azureml-fe.yaml`.
313+
314+
1. Deploy `ing-azureml-fe.yaml` by running:
315+
316+
```bash
317+
kubectl apply -f ing-azureml-fe.yaml
318+
```
319+
320+
2. Check the log of the ingress controller for deployment status.
321+
322+
3. Now the `azureml-fe` application should be available. You can check this by visiting:
323+
- **Nginx Ingress Controller**: the public LoadBalancer address of Nginx Ingress Controller
324+
- **Azure Application Gateway**: the public address of the Application Gateway.
325+
4. [Create an inference job and invoke](https://github.com/Azure/AML-Kubernetes/blob/master/docs/simple-flow.md).
326+
327+
>[!NOTE]
328+
>
329+
> Replace the ip in scoring_uri with public LoadBalancer address of the Nginx Ingress Controller before invoking.
330+
331+
### Expose services over HTTPS
332+
333+
1. Before deploying ingress, you need to create a kubernetes secret to host the certificate and private key. You can create a kubernetes secret by running
334+
335+
```bash
336+
kubectl create secret tls <ingress-secret-name> -n azureml --key <path-to-key> --cert <path-to-cert>
337+
```
338+
339+
2. Define the following ingress. In the ingress, specify the name of the secret in the `secretName` section.
340+
341+
```yaml
342+
# Nginx Ingress Controller example
343+
apiVersion: networking.k8s.io/v1
344+
kind: Ingress
345+
metadata:
346+
name: azureml-fe
347+
namespace: azureml
348+
spec:
349+
ingressClassName: nginx
350+
tls:
351+
- hosts:
352+
- <domain>
353+
secretName: <ingress-secret-name>
354+
rules:
355+
- host: <domain>
356+
http:
357+
paths:
358+
- path: /
359+
backend:
360+
service:
361+
name: azureml-fe
362+
port:
363+
number: 80
364+
pathType: Prefix
365+
```
366+
367+
```yaml
368+
# Azure Application Gateway example
369+
apiVersion: networking.k8s.io/v1
370+
kind: Ingress
371+
metadata:
372+
name: azureml-fe
373+
namespace: azureml
374+
spec:
375+
ingressClassName: azure-application-gateway
376+
tls:
377+
- hosts:
378+
- <domain>
379+
secretName: <ingress-secret-name>
380+
rules:
381+
- host: <domain>
382+
http:
383+
paths:
384+
- path: /
385+
backend:
386+
service:
387+
name: azureml-fe
388+
port:
389+
number: 80
390+
pathType: Prefix
391+
```
392+
393+
>[!NOTE]
394+
>
395+
> Replace `<domain>` and `<ingress-secret-name>` in the above Ingress Resource with the domain pointing to LoadBalancer of the **Nginx ingress controller/Application Gateway** and name of your secret. Store the above Ingress Resource in a file name `ing-azureml-fe-tls.yaml`.
396+
397+
1. Deploy ing-azureml-fe-tls.yaml by running
398+
399+
```bash
400+
kubectl apply -f ing-azureml-fe-tls.yaml
401+
```
402+
403+
2. Check the log of the ingress controller for deployment status.
404+
405+
3. Now the `azureml-fe` application will be available on HTTPS. You can check this by visiting the public LoadBalancer address of the Nginx Ingress Controller.
406+
407+
4. [Create an inference job and invoke](../machine-learning/how-to-deploy-online-endpoints.md).
408+
409+
>[!NOTE]
410+
>
411+
> Replace the protocol and IP in scoring_uri with https and domain pointing to LoadBalancer of the Nginx Ingress Controller or the Application Gateway before invoking.
412+
413+
## Use ARM Template to Deploy Extension
414+
Extension on managed cluster can be deployed with ARM template. A sample template can be found from [deployextension.json](https://github.com/Azure/AML-Kubernetes/blob/master/files/deployextension.json), with a demo parameter file [deployextension.parameters.json](https://github.com/Azure/AML-Kubernetes/blob/master/files/deployextension.parameters.json)
415+
416+
To leverage the sample deployment template, edit the parameter file with correct value, then run the following command:
417+
418+
```azurecli
419+
az deployment group create --name <ARM deployment name> --resource-group <resource group name> --template-file deployextension.json --parameters deployextension.parameters.json
420+
```
421+
More information about how to use ARM template can be found from [ARM template doc](../azure-resource-manager/templates/overview.md)
422+
423+
245424
## Azureml extension release note
246425
> [!NOTE]
247426
>

0 commit comments

Comments
 (0)