Azure Kubernetes Setup with App Gateway using Azure CLI

How to Setup Azure Kubernetes Cluster with App Gateway as Ingress Controller: 

Following are key steps to launch AKS Cluster with Azure AppGw as Ingress Controller (AGIC).

1. Connect to Azure Tenant and Subscription through Azure CLI

2. Resource Group Setup:

Create a new resource group (if not already created at start) using below command

az group create --name PROD --location eastus2

2. Create Cluster and App Gateway

Create a new aks cluster (aks-prod) with app gateway (appgw-prod) using below command.

az aks create -n aks-prod -g PROD --network-plugin azure --enable-managed-identity -a ingress-appgw --appgw-name appgw-prod --appgw-subnet-cidr "" --generate-ssh-keys

3. Connect to AKS Cluster:

Once aks cluster will be created through CLI, open its configurations from Azure Portal under 

"Kubernetes Services" then click "cluster name" and click "connect"

A new windows will appear at the right side which shows command to connect to this AKS cluster and also some basic kubernetes administration commands. 

Use following command to connect to newly created cluster "aks-prod".

az aks get-credentials --resource-group PROD --name aks-prod

4. AKS Cluster Validation:

Execute following command to check current connected cluster and namespace

kubectl config get-contexts