<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Alfredy Toro on Medium]]></title>
        <description><![CDATA[Stories by Alfredy Toro on Medium]]></description>
        <link>https://medium.com/@alfredy.toro?source=rss-1fbe20b23868------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*e8GUohJ_8bb86Eh7YsFGxg.png</url>
            <title>Stories by Alfredy Toro on Medium</title>
            <link>https://medium.com/@alfredy.toro?source=rss-1fbe20b23868------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 02 Dec 2026 03:33:08 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@alfredy.toro/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Multi-Cluster/Shared Application Gateway Ingress Controller for Azure Kubernetes Service]]></title>
            <link>https://medium.com/globant/multi-cluster-shared-application-gateway-ingress-controller-for-azure-kubernetes-service-928ab7d2cbdc?source=rss-1fbe20b23868------2</link>
            <guid isPermaLink="false">https://medium.com/p/928ab7d2cbdc</guid>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[cloud-computing]]></category>
            <category><![CDATA[cloudops]]></category>
            <category><![CDATA[azure-kubernetes-service]]></category>
            <category><![CDATA[azure]]></category>
            <dc:creator><![CDATA[Alfredy Toro]]></dc:creator>
            <pubDate>Mon, 27 Mar 2023 18:31:52 GMT</pubDate>
            <atom:updated>2023-03-29T13:22:31.792Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/584/1*mj1leHUvQPbuOHBnSb2L9A.png" /></figure><p>We know that Azure’s Application Gateway Ingress Controller (AGIC) is the ingress controller to use by default in AKS, since, internally, it has a plugin that allows us to use Azure’s native <a href="https://azure.microsoft.com/en-us/products/application-gateway/">Application Gateway</a> L7 load balancer to expose our services and thus continue using functionalities within the Azure world and not resort to external solutions like <a href="https://docs.nginx.com/nginx-ingress-controller/">Nginx</a> or <a href="https://doc.traefik.io/traefik/providers/kubernetes-ingress/">Traefik</a>.</p><p>Besides implementing AGIC as a plugin, there is another method to install it using <a href="https://helm.sh/docs/">Helm </a>charts. There are soBoth methods have some differencesin difference is that with Helm, we can have more control over how we implement our ingress controller and make our Application Gateway go from being a simple controller to one that can expose other types of existing backends, like web applications.</p><h3>Prerequisites</h3><p>For you to follow these steps successfully, you will need the following:</p><ul><li>An Azure Cloud Subscription</li><li>Azure Cloud Shell (already has all the necessary tools). If you choose to use another environment, please ensure the following command line tools are installed as well:</li><li><strong>az</strong> — Azure CLI: <a href="https://docs.microsoft.com/en-us/cli/azure/install-azure-cli?view=azure-cli-latest">installation instructions</a></li><li><strong>kubectl</strong> — Kubernetes command-line tool: <a href="https://kubernetes.io/docs/tasks/tools/install-kubectl">installation instructions</a></li><li><strong>helm</strong> — Kubernetes package manager: <a href="https://github.com/helm/helm/releases/latest">installation instructions</a></li><li><strong>jq</strong> — command-line JSON processor: <a href="https://stedolan.github.io/jq/download/">installation instructions</a></li></ul><h3>Multi-cluster/Shared Application Gateway Installation</h3><p>We will use Azure’s CLI <em>az</em> command to create all the resources needed to deploy the Multi-cluster/Shared App Gateway. If you already have an Azure cluster with an Application Gateway available, you can skip this section and go directly to Managed identities configuration.</p><h4>AKS Cluster Deployment</h4><p>First, we need to create the Kubernetes cluster. Define the shell variables needed to create all resources:</p><pre>$ RESOURCE_GROUP=&quot;aks-agichelm-demo&quot;<br>$ LOCATION=&quot;eastus&quot;<br>$ AKS_NAME=&quot;aks-agichelm-demo&quot;<br>$ VNET_NAME=&quot;aks-vnet&quot;<br>$ AKS_SUBNET=&quot;aks-subnet&quot;</pre><p>Create the Resource group:</p><pre>$ az group create - name $RESOURCE_GROUP - location $LOCATION<br>$ RESOURCE_GROUP_ID=$(az group show - name $RESOURCE_GROUP - query id -o tsv)</pre><p>Create the Virtual Network — Subnet for the AKS:</p><pre>$ az network vnet create \<br> - resource-group $RESOURCE_GROUP \<br> - name $VNET_NAME \<br> - address-prefixes 10.0.0.0/8 \<br> - subnet-name $AKS_SUBNET \<br> - subnet-prefix 10.10.0.0/16</pre><p>Get the VNET ID:</p><pre>$ SUBNET_ID=$(az network vnet subnet show -g $RESOURCE_GROUP -n $AKS_SUBNET - vnet-name $VNET_NAME - query id -o tsv)</pre><p>Create the User Identity — AKS:</p><pre>$ az identity create - name $AKS_NAME-identity - resource-group $RESOURCE_GROUP</pre><p>Get the Managed Identity ID:</p><pre>$ IDENTITY_ID=$(az identity show - name $AKS_NAME-identity - resource-group $RESOURCE_GROUP - query id -o tsv)<br>$ IDENTITY_CLIENT_ID=$(az identity show - name $AKS_NAME-identity - resource-group $RESOURCE_GROUP - query clientId -o tsv)</pre><p>Create the AKS cluster:</p><pre>$ az aks create \<br> - resource-group $RESOURCE_GROUP \<br> - name $AKS_NAME \<br> - node-vm-size Standard_B4ms \<br> - network-plugin azure \<br> - vnet-subnet-id $SUBNET_ID \<br> - docker-bridge-address 172.17.0.1/16 \<br> - dns-service-ip 10.2.0.10 \<br> - service-cidr 10.2.0.0/24 \<br> - enable-managed-identity \<br> - assign-identity $IDENTITY_ID</pre><h4>Managed Identities</h4><p>We assign the roles to the internal managed identity of the cluster (a kubelet managed identity), so that later the installation of the <em>Azure AD Pod Identity</em> is successful. Now, we have to create the managed identities and roles allocations:</p><p>Get the AKS Cluster with Managed Identity:</p><pre>$ KUBELET_CLIENT_ID=$(az aks show -g $RESOURCE_GROUP -n $AKS_NAME - query identityProfile.kubeletidentity.clientId -o tsv)</pre><p>Get the Node Resource Group name:</p><pre>$ NODE_RESOURCE_GROUP=$(az aks show - resource-group $RESOURCE_GROUP - name $AKS_NAME - query nodeResourceGroup -o tsv)<br>$ NODE_RESOURCE_GROUP_ID=$(az group show - name $NODE_RESOURCE_GROUP - query id -o tsv)</pre><p>Perform role assignments:</p><pre>$ az role assignment create - role &quot;Managed Identity Operator&quot; - assignee $KUBELET_CLIENT_ID - scope $NODE_RESOURCE_GROUP_ID<br>$ az role assignment create - role &quot;Virtual Machine Contributor&quot; - assignee $KUBELET_CLIENT_ID - scope $NODE_RESOURCE_GROUP_ID<br># User-assigned identities that are not within the node resource group<br>$ az role assignment create - role &quot;Managed Identity Operator&quot; - assignee $KUBELET_CLIENT_ID - scope $RESOURCE_GROUP_ID<br>$ az role assignment list - assignee $KUBELET_CLIENT_ID -o table - all</pre><h4>Application Gateway Deployment</h4><p>We will create the Application Gateway and the other involved resource, such as the subnet, public IP address, etc. The following code explains how to create these resources:</p><p>Define variables:</p><pre>$ APPGW_SUBNET=&quot;appgw-subnet&quot;<br>$ APP_GW_NAME=&quot;app-gw&quot;</pre><p>Create the subnet for the Application Gateway:</p><pre>$ az network vnet subnet create \<br> - resource-group $RESOURCE_GROUP \<br> - vnet-name $VNET_NAME \<br> - name $APPGW_SUBNET \<br> - address-prefixes 10.20.0.0/16</pre><p>Create the public IP address:</p><pre>$ az network public-ip create \<br> - resource-group $RESOURCE_GROUP \<br> - name $APP_GW_NAME-public-ip \<br> - allocation-method Static \<br> - sku Standard</pre><p>Create the Application Gateway:</p><pre>$ az network application-gateway create \<br> - resource-group $RESOURCE_GROUP \<br> - name $APP_GW_NAME \<br> - location $LOCATION \<br> - vnet-name $VNET_NAME \<br> - subnet $APPGW_SUBNET \<br> - public-ip-address $APP_GW_NAME-public-ip \<br> - sku WAF_v2 \<br> - capacity 1</pre><h4>Azure AD Pod Identity and AGIC with Helm</h4><p>Now can we interact directly in the cluster to install components, such as <a href="https://learn.microsoft.com/en-us/azure/aks/use-azure-ad-pod-identity">Azure AD Pod Identity</a> and AGIC, using Helm. The following code explains how to install and configure Azure AD Pod Identity and customize the helm chart:</p><p>Obtain AKS credentials:</p><pre>$ az aks get-credentials - resource-group $RESOURCE_GROUP - name $AKS_NAME</pre><p>For Azure AD Pod Identity is mandatory to install and configure AGIC:</p><pre>$ helm repo add aad-pod-identity https://raw.githubusercontent.com/Azure/aad-pod-identity/master/charts<br>$ helm install aad-pod-identity aad-pod-identity/aad-pod-identity -n kube-system</pre><p>Check Azure AD Pod identity pods:</p><pre>$ kubectl get pods -n kube-system -l app.kubernetes.io/name=aad-pod-identity</pre><p>For the Azure Portal, create an identity for the AGIC controller:</p><pre>$ az identity create -g $RESOURCE_GROUP -n $APP_GW_NAME-identity</pre><p>Get the client and the identity ids:</p><pre>$ APP_GW_IDENTITY_CLIENT_ID=$(az identity show -g $RESOURCE_GROUP -n $APP_GW_NAME-identity -o tsv - query &quot;clientId&quot;)<br>$ APP_GW_IDENTITY_RESOURCE_ID=$(az identity show -g $RESOURCE_GROUP -n $APP_GW_NAME-identity -o tsv - query &quot;id&quot;)<br>$ APP_GW_ID=$(az network application-gateway show -g $RESOURCE_GROUP -n $APP_GW_NAME - query id -o tsv)</pre><p>Assign the <em>Contributor</em> role to the identity over the Application Gateway:</p><pre>$ az role assignment create \<br> - role &quot;Contributor&quot; \<br> - assignee $APP_GW_IDENTITY_CLIENT_ID \<br> - scope $APP_GW_ID<br>$ az role assignment create \<br> - role &quot;Reader&quot; \<br> - assignee $APP_GW_IDENTITY_CLIENT_ID \<br> - scope $RESOURCE_GROUP_ID</pre><p>In Azure Cloud Shell, set up the AGIC Helm repository:</p><pre>$ helm repo add application-gateway-kubernetes-ingress https://appgwingress.blob.core.windows.net/ingress-azure-helm-package/<br>$ helm repo update</pre><p>Now we have to edit the <em>helm-config.yaml</em> file (you can use vim or nano editors):</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/272686c5778549c817bc7fb292ae8cea/href">https://medium.com/media/272686c5778549c817bc7fb292ae8cea/href</a></iframe><p>In that file, we are creating a specific Ingress called <em>azure-application-gateway-dev</em> for only two specific namespaces. We also have two authentication options; we will use the managed identity we created in the previous lines (APP_GW_IDENTITY_CLIENT_ID, APP_GW_IDENTITY_RESOURCE_ID).</p><p>Before running the helm chart installation, the dev-1 and dev-2 namespaces must be previously created:</p><pre>$ kubectl create namespace dev-1<br>$ kubectl create namespace dev-2</pre><p>Install the Helm chart:</p><pre>$ helm install agic-dev -f helm-config.yaml application-gateway-kubernetes-ingress/ingress-azure -n kube-system</pre><p>Check that the Ingress is in a “Running” state with this command:</p><pre>$ kubectl get pods -n kube-system -l release=agic-dev<br>NAME                                            READY STATUS  RESTARTS AGE<br>agic-dev-ingress-azure-55f75fd8d7-l5r8j         1/1   Running 0        167d</pre><p>Now the AGIC is ready to receive Ingress configurations in the two previous namespaces. Apply your deployments and services using an Ingress template similar to this one:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/747e4550bbaabaa11f5fad5316086a7f/href">https://medium.com/media/747e4550bbaabaa11f5fad5316086a7f/href</a></iframe><h4>Multi-cluster / Shared App Gateway</h4><p>By default, AGIC assumes full ownership and control of the Application Gateway it is linked to. But we can manipulate this behavior to use the same Application Gateway to expose an application hosted in a virtual machine or <a href="https://azure.microsoft.com/en-us/products/app-service">App Service</a> together with an AKS cluster.</p><p>This can be achieved by configuring an <em>AzureIngressProhibitedTarget</em> object, as we can add other backends with their specific hostname and all the settings (<em>backendpools, listeners, https-settings</em>) related to that hostname will be kept along with the services exposed by AKS.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/a7e4bf7239031c783e2094c3bc01638f/href">https://medium.com/media/a7e4bf7239031c783e2094c3bc01638f/href</a></iframe><p>By default, for any configuration of a hostname not declared in this type of object, AGIC will remove the configuration in seconds.</p><h3>Conclusions</h3><p>In this article, using a Helm chart, we implemented a Kubernetes cluster with all the necessary resources to implement a Multi-Cluster/Shared Application Gateway Ingress Controller for different endpoints and namespaces.</p><p>With this implementation of an Application Gateway, we will have more control over our Ingress controller, allowing multiple Ingress for different namespaces using native and supported solutions from Microsoft. This kind of implementation helps reduce costs or to control development environments.</p><p>This scenario is also valid when we must migrate applications to containers that need to run together but with different endpoints and certificates, configuring them using annotations with key/value pairs from an Ingress resource.</p><h3>References</h3><ul><li><a href="https://learn.microsoft.com/en-us/azure/application-gateway/ingress-controller-overview"><strong>https://learn.microsoft.com/en-us/azure/application-gateway/ingress-controller-overview</strong></a></li><li><a href="https://azure.github.io/application-gateway-kubernetes-ingress/"><strong>https://azure.github.io/application-gateway-kubernetes-ingress/</strong></a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=928ab7d2cbdc" width="1" height="1" alt=""><hr><p><a href="https://medium.com/globant/multi-cluster-shared-application-gateway-ingress-controller-for-azure-kubernetes-service-928ab7d2cbdc">Multi-Cluster/Shared Application Gateway Ingress Controller for Azure Kubernetes Service</a> was originally published in <a href="https://medium.com/globant">Globant</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>