Search code examples
azureazure-aksnginx-ingress

Removing catch all path breaks ingress


I create a brand new AKS without customization.

I apply this simple ingress example : https://learn.microsoft.com/en-us/azure/aks/ingress-basic?tabs=azure-cli

  • path: /(.*) pathType: Prefix backend: service: name: aks-helloworld-one port: number: 80

This snippet is contained in the example. When I remove it all other paths break as well.

Why is that?


Solution

  • In a huge twist it turns out that the ms implementation configures the load balancer with a /healthz check that originates from the load balancer. So In order to keep the load balancer traffic coming you need to have an ingress route to /healthz that returns a 200. Coincidentally that was caught by the catch all route thus fulfilling the /healthz requirement of the azure load balancer.

    I assume this is something that is set in the helm chart of the default installation used in that microsoft example.

    By removing the demo app from the cluster you are also removing the response to /healthz and the load balancer will no longer forward traffic to your ingress.