AKS exposing application using HTTP application routing

5/23/2019

I'm trying to expose application using HTTP application routing. I enabled http_application_routing addons which is result in this config :

  "addonProfiles": {
    "httpapplicationrouting": {
      "config": {
        "HTTPApplicationRoutingZoneName": "****.northeurope.aksapp.io",
        "httpapplicationroutingzonename": "****.northeurope.aksapp.io"
      },
      "enabled": true
    }
  }

I created ingress resource :

apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  annotations:
    kubernetes.io/ingress.class: addon-http-application-routing
  labels:
    name: axon-azure
  name: axon-ing-azure
spec:
  rules:
  - host: axon.****.northeurope.aksapp.io
    http:
      paths:
      - backend:
          serviceName: axon-svc
          servicePort: 8024
        path: /

But it doesn't work when I test it :

curl axon.****.northeurope.aksapp.io
curl: (6) Could not resolve host: axon.****.northeurope.aksapp.io

Following the AKS documentation, I'm thinking about a DNS problem because the DNS zone name doesn't appear using this command (but I don't know why) :

az aks show --resource-group myResourceGroup --name myAKSCluster --query addonProfiles.httpApplicationRouting.config.HTTPApplicationRoutingZoneName -o table

Any idea of what's going wrong in this case ?

-- Nicolas Pepinster
azure
azure-aks
kubernetes
kubernetes-ingress

1 Answer

5/27/2019

For the HTTP application routing in AKS, when you enable the routing feature using the CLI command:

az aks enable-addons --resource-group your_resource_group --name your_akscluster --addons http_application_routing

If there is no error, then you can get the DNS zone that Azure creates for you through the CLI command:

az aks show --resource-group your_resource_group --name your_akscluster --query addonProfiles.httpApplicationRouting.config.HTTPApplicationRoutingZoneName -o table

In the above two CLI commands, you need to change the your_resource_group and your_akscluster with your own group and AKS.

And after you create the ingress with the yaml file, you should wait a bit long time which Azure create the record for you in the DNS zone. Maybe 5 minutes are needed. You can take a look if the record is already in the DNS zone.

If you need the HTTP route, I will suggest you create it yourself following the steps in Create an ingress controller in Azure Kubernetes Service (AKS) or Use a static IP. In this way, you will know exactly which step you have done or mistake.

-- Charles Xu
Source: StackOverflow