We have discussed how to setup AGIC for AKS in the simplest way as an addon to AKS using Azure portal ina previous post. In this post lets look at how we can get a new AKS cluster setup with kubent networking and add Application Gateway Ingress Controller as addon to it.
Lets get started with setting the required providers in terraform. We need to use the azurerm provider. When you use azurerm always use the latest version.
Then we can create a resource group for the aks cluster as shown below.
The next step is creating the AKS cluster with the kubenet as networking profile. Note the comments in ingress_application_gateway block.
This is similar to what we have done in the portal as explained in the post here. The app gatway is added as addon to AKS clsuter as shown below.
Let's verify if our AKS and AGIC deployment with terraform works as expected by deploying a sample app. We can deploy a test app to the AKS cluster with command below
kubectl apply -f https://raw.githubusercontent.com/Azure/application-gateway-kubernetes-ingress/master/docs/examples/aspnetapp.yaml
We can see the app gatway is updating based on ingress defined in AKS.
Ingress in AKS.
App gatway backend health connecting to pod deployed.
App is running and served via app gateway ingress controller.
No comments:
Post a Comment