azuressl-certificateazure-aksazure-application-gatewaytraefik-ingress

Custom Domain and Certificates on AKS with App Gateway


I'm struggling to understand how all things need to be configured in the following scenario:

So, I've applied another custom domain to the Static Web App (<appname>.dev.client.com), the certificate is not needed as it's created automatically by Azure. All good here.

Now I would like to understand how and what I need to configure for the Application Gateway and AKS to work properly with the new certificate and domain. At the moment I have:

In all of this, which certificate am I supposed to pass to the AKS ingress controller? The custom one tied to my domain? How is it going to validate it against my domain?


Solution

  • You can use HTTPS listener api.<appname>.dev.client.com as the host name so that application gateway listens for incoming requests on the custom domain and forward them to the appropriate backend pool of your AKS cluster.

    You can apply the certificate stored in Key Vault using terraform or via portal like below:

    enter image description here

    enter image description here

    You can also use a self-signed certificate You need to upload the root certificate of your certificate to the Application Gateway but the cert on App Gateway should be trusted.

    enter image description here

    Make sure that neither the hostname for the Custom Probe nor the hostname for the Backend configuration (in that order) matches the Common Name of the backend server's certificate when you select the HTTPS protocol in the backend configuration. Refer

    while using Custom Probe you can use the host field to specify the Common Name of the backend server certificate.

    enter image description here

    In the probe settings, you can select Pick hostname from backend setting if the Backend Setting has been configured with the same hostname.

    enter image description here

    At last, you have to pass the Custom certificate associated with your domain to the AKS Ingress Controller. The AKS Ingress Controller will validate the certificate against the domain specified in the certificate