Multiple Site Hosting on Azure Application Gateway Integrated with Azure AKS

Yst@IT
3 min readJan 2, 2021

--

Azure AKS ingress controller with application gateway hosting multiple sites

Image: https://docs.microsoft.com/en-us/azure/application-gateway/ingress-controller-overview

In last post, I Integrate Azure Application Gateway Ingress Controller with AKS. In this post, I will configure multiple sites on A.G

What is Application Gateway Ingress Controller?

The Application Gateway Ingress Controller (AGIC) is a Kubernetes application, which makes it possible for Azure Kubernetes Service (AKS) customers to leverage Azure’s native Application Gateway L7 load-balancer to expose cloud software to the Internet. AGIC monitors the Kubernetes cluster it is hosted on and continuously updates an Application Gateway, so that selected services are exposed to the Internet.

The Ingress Controller runs in its own pod on the customer’s AKS. AGIC monitors a subset of Kubernetes Resources for changes. The state of the AKS cluster is translated to Application Gateway specific configuration and applied to the Azure Resource Manager (ARM).

Azure AKS ingress controller with application gateway hosting multiple sites

Image: https://docs.microsoft.com/en-us/azure/aks/concepts-network#ingress-controllers

We have already provisioned an Azure Application Gateway in the previous post. In order for A.G to interact with AKS cluster, we need an ingress controller which looks like image above.

From the ingress yaml file, it is where we configure how the routing should go, for example, multiple domain/different sub-domain/path routing.

My example yaml file for this post is as below. Everything is the same beside the keyword, nginx and httpd are different, as well as the host FQDN at line 46.

Apply both yaml file to AKS.

Azure AKS ingress controller with application gateway hosting multiple sites

We can see that resources are provisioned as expected, with two ingress controllers.

Azure AKS ingress controller with application gateway hosting multiple sites

With DNS properly setup.

Azure AKS ingress controller with application gateway hosting multiple sites

We can verify that Application Gateway is routing traffic to the corresponding destination correctly.

Azure AKS ingress controller with application gateway hosting multiple sites
Azure AKS ingress controller with application gateway hosting multiple sites

That’s it for today! Next I will be writing a post about SSL integration, stay tuned!

--

--

Yst@IT

Cloud Solution Architect, focusing on Oracle Cloud Infrastructure currently.