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
title: 'Tutorial: Enable the Ingress Controller add-on for a new AKS cluster with a new Azure Application Gateway'
3
-
description: Use this tutorial to learn how to enable the Ingress Controller add-on for your new AKS cluster with a new Application Gateway instance.
2
+
title: 'Tutorial: Enable the Ingress Controller add-on for a new AKS cluster with a new Azure application gateway'
3
+
description: Use this tutorial to learn how to enable the Ingress Controller add-on for your new AKS cluster with a new application gateway instance.
4
4
services: application-gateway
5
5
author: caya
6
6
ms.service: application-gateway
7
7
ms.topic: tutorial
8
-
ms.date: 03/02/2021
8
+
ms.date: 07/12/2022
9
9
ms.author: caya
10
+
ms.custom: template-tutorial #Required; leave this attribute/value as-is.
10
11
---
11
12
12
-
# Tutorial: Enable the Ingress Controller add-on for a new AKS cluster with a new Application Gateway instance
13
+
# Tutorial: Enable the ingress controller add-on for a new AKS cluster with a new application gateway instance
13
14
14
-
You can use the Azure CLI to enable the [Application Gateway Ingress Controller (AGIC)](ingress-controller-overview.md) add-on for a new [Azure Kubernetes Services (AKS)](https://azure.microsoft.com/services/kubernetes-service/) cluster.
15
+
You can use the Azure CLI to enable the [application gateway ingress controller (AGIC)](ingress-controller-overview.md) add-on for a new [Azure Kubernetes Services (AKS)](https://azure.microsoft.com/services/kubernetes-service/) cluster.
15
16
16
-
In this tutorial, you'll create an AKS cluster with the AGIC add-on enabled. Creating the cluster will automatically create an Azure Application Gateway instance to use. You'll then deploy a sample application that will use the add-on to expose the application through Application Gateway.
17
+
In this tutorial, you'll create an AKS cluster with the AGIC add-on enabled. Creating the cluster will automatically create an Azure application gateway instance to use. You'll then deploy a sample application that will use the add-on to expose the application through application gateway.
17
18
18
19
The add-on provides a much faster way to deploy AGIC for your AKS cluster than [previously through Helm](ingress-controller-overview.md#difference-between-helm-deployment-and-aks-add-on). It also offers a fully managed experience.
19
20
@@ -23,83 +24,93 @@ In this tutorial, you learn how to:
23
24
> * Create a resource group.
24
25
> * Create a new AKS cluster with the AGIC add-on enabled.
25
26
> * Deploy a sample application by using AGIC for ingress on the AKS cluster.
26
-
> * Check that the application is reachable through Application Gateway.
27
+
> * Check that the application is reachable through application gateway.
In Azure, you allocate related resources to a resource group. Create a resource group by using [az group create](/cli/azure/group#az-group-create). The following example creates a resource group named *myResourceGroup* in the *canadacentral* location (region):
35
+
In Azure, you allocate related resources to a resource group. Create a resource group by using [az group create](/cli/azure/group#az-group-create). The following example creates a resource group named **myResourceGroup** in the **East US** location (region):
35
36
36
37
```azurecli-interactive
37
-
az group create --name myResourceGroup --location canadacentral
38
+
az group create --name myResourceGroup --location eastus
38
39
```
39
40
40
41
## Deploy an AKS cluster with the add-on enabled
41
42
42
-
You'll now deploy a new AKS cluster with the AGIC add-on enabled. If you don't provide an existing Application Gateway instance to use in this process, we'll automatically create and set up a new Application Gateway instance to serve traffic to the AKS cluster.
43
+
You'll now deploy a new AKS cluster with the AGIC add-on enabled. If you don't provide an existing application gateway instance to use in this process, you'll automatically create and set up a new application gateway instance to serve traffic to the AKS cluster.
43
44
44
45
> [!NOTE]
45
-
> The Application Gateway Ingress Controller add-on supports *only*Application Gateway v2 SKUs (Standard and WAF), and *not* the Application Gateway v1 SKUs. When you're deploying a new Application Gateway instance through the AGIC add-on, you can deploy only an Application Gateway Standard_v2 SKU. If you want to enable the add-on for an Application Gateway WAF_v2 SKU, use either of these methods:
46
+
> The application gateway ingress controller add-on supports *only*application gateway v2 SKUs (Standard and WAF), and *not* the application gateway v1 SKUs. When you're deploying a new application gateway instance through the AGIC add-on, you can deploy only an application gateway Standard_v2 SKU. If you want to enable the add-on for an application gateway WAF_v2 SKU, use either of these methods:
46
47
>
47
-
> - Enable WAF on Application Gateway through the portal.
48
-
> - Create the WAF_v2 Application Gateway instance first, and then follow instructions on how to [enable the AGIC add-on with an existing AKS cluster and existing Application Gateway instance](tutorial-ingress-controller-add-on-existing.md).
48
+
> - Enable WAF on application gateway through the portal.
49
+
> - Create the WAF_v2 application gateway instance first, and then follow instructions on how to [enable the AGIC add-on with an existing AKS cluster and existing application gateway instance](tutorial-ingress-controller-add-on-existing.md).
49
50
50
-
In the following example, you'll deploy a new AKS cluster named *myCluster* by using [Azure CNI](../aks/concepts-network.md#azure-cni-advanced-networking) and [managed identities](../aks/use-managed-identity.md). The AGIC add-on will be enabled in the resource group that you created, *myResourceGroup*.
51
+
In the following example, you'll deploy a new AKS cluster named *myCluster* by using [Azure CNI](../aks/concepts-network.md#azure-cni-advanced-networking) and [managed identities](../aks/use-managed-identity.md). The AGIC add-on will be enabled in the resource group that you created, **myResourceGroup**.
51
52
52
-
Deploying a new AKS cluster with the AGIC add-on enabled without specifying an existing Application Gateway instance will mean an automatic creation of a Standard_v2 SKU Application Gateway instance. So, you'll also specify the name and subnet address space of the Application Gateway instance. The name of the Application Gateway instance will be *myApplicationGateway*, and the subnet address space we're using is 10.2.0.0/16.
53
+
Deploying a new AKS cluster with the AGIC add-on enabled without specifying an existing application gateway instance will mean an automatic creation of a Standard_v2 SKU application gateway instance. So, you'll also specify the name and subnet address space of the application gateway instance. The name of the application gateway instance will be **myApplicationGateway**, and the subnet address space will be **10.225.0.0/16**.
53
54
54
55
```azurecli-interactive
55
-
az aks create -n myCluster -g myResourceGroup --network-plugin azure --enable-managed-identity -a ingress-appgw --appgw-name myApplicationGateway --appgw-subnet-cidr "10.2.0.0/16" --generate-ssh-keys
56
+
az aks create -n myCluster -g myResourceGroup --network-plugin azure --enable-managed-identity -a ingress-appgw --appgw-name myApplicationGateway --appgw-subnet-cidr "10.225.0.0/16" --generate-ssh-keys
56
57
```
57
58
58
-
To configure additional parameters for the `az aks create`command, see [these references](/cli/azure/aks#az-aks-create).
59
+
To configure more parameters for the above command, got to [az aks create](/cli/azure/aks#az-aks-create).
59
60
60
61
> [!NOTE]
61
-
> The AKS cluster that you created will appear in the resource group that you created, *myResourceGroup*. However, the automatically created Application Gateway instance will be in the node resource group, where the agent pools are. The node resource group by is named *MC_resource-group-name_cluster-name_location* by default, but can be modified.
62
+
> The AKS cluster that you created will appear in the resource group that you created, **myResourceGroup**. However, the automatically created application gateway instance will be in the node resource group, where the agent pools are. The node resource group is named **MC_resource-group-name_cluster-name_location** by default, but can be modified.
62
63
63
64
## Deploy a sample application by using AGIC
64
65
65
-
You'll now deploy a sample application to the AKS cluster that you created. The application will use the AGIC add-on for ingress and connect the Application Gateway instance to the AKS cluster.
66
+
You'll now deploy a sample application to the AKS cluster that you created. The application will use the AGIC add-on for ingress and connect the application gateway instance to the AKS cluster.
66
67
67
68
First, get credentials to the AKS cluster by running the `az aks get-credentials` command:
68
69
69
70
```azurecli-interactive
70
71
az aks get-credentials -n myCluster -g myResourceGroup
71
72
```
72
73
73
-
Now that you have credentials, run the following command to set up a sample application that uses AGIC for ingress to the cluster. AGIC will update the Application Gateway instance that you set up earlier with corresponding routing rules to the new sample application that you deployed.
74
+
Now that you have credentials, run the following command to set up a sample application that uses AGIC for ingress to the cluster. AGIC will update the application gateway instance that you set up earlier with corresponding routing rules to the sample application you're deploying.
Now that the Application Gateway instance is set up to serve traffic to the AKS cluster, let's verify that your application is reachable. First, get the IP address of the ingress:
82
+
Now that the application gateway instance is set up to serve traffic to the AKS cluster, let's verify that your application is reachable. First, get the IP address of the ingress:
82
83
83
84
```azurecli-interactive
84
85
kubectl get ingress
85
86
```
86
87
87
88
Check that the sample application that you created is running by either:
88
89
89
-
- Visiting the IP address of the Application Gateway instance that you got from running the preceding command.
90
+
- Visiting the IP address of the application gateway instance that you got from running the preceding command.
90
91
- Using `curl`.
91
92
92
-
Application Gateway might take a minute to get the update. If Application Gateway is still in an **Updating** state on the portal, let it finish before you try to reach the IP address.
93
+
Application gateway might take a minute to get the update. If application gateway is still in an **Updating** state on the portal, let it finish before you try to reach the IP address.
93
94
94
95
## Clean up resources
95
96
96
-
When you no longer need them, remove the resource group, the Application Gateway instance, and all related resources:
97
+
When you no longer need them, delete all resources created in this tutorial by deleting **myResourceGroup**and **MC_myResourceGroup_myCluster_eastus** resource groups:
97
98
98
99
```azurecli-interactive
99
100
az group delete --name myResourceGroup
101
+
az group delete --name MC_myResourceGroup_myCluster_eastus
100
102
```
101
103
102
104
## Next steps
103
105
106
+
In this tutorial, you:
107
+
108
+
- Created new AKS cluster with the AGIC add-on enabled
109
+
- Deployed a sample application by using AGIC for ingress on the AKS cluster
110
+
111
+
To learn more about AGIC, see [What is Application Gateway Ingress Controller?](ingress-controller-overview.md) and [Disable and re-enable AGIC add-on for your AKS cluster](ingress-controller-disable-addon.md)
112
+
113
+
To learn how to enable application gateway ingress controller add-on for an existing AKS cluster with an existing application gateway, advance to the next tutorial.
114
+
104
115
> [!div class="nextstepaction"]
105
-
> [Learn about disabling the AGIC add-on](./ingress-controller-disable-addon.md)
116
+
> [Enable AGIC for existing AKS and application gateway](tutorial-ingress-controller-add-on-existing.md)
0 commit comments