<p>I've followed this doc from microsoft <a href="https://learn.microsoft.com/en-us/azure/aks/ingress" rel="noreferrer">Deploy an HTTPS ingress controller on Azure Kubernetes Service (AKS)</a> and have successfully deployed a managed Kubernetes cluster (AKS) with nginx ingress controller.  it works with https as expected.</p>

<p>However, the domain that responds of the format <strong>subdomain.eastus2.cloudapp.azure.com</strong>.  However I would like to use my own custom domain <strong>www.somedomain.com</strong>.  I then add a CNAME entry to my custom domain, pointing to the public ip address configured by the kubernetes cluster.</p>

<p>However, when I do this, I get a response on the browser of </p>

<p><strong>default backend - 404</strong></p>

<p>It looks like I need to change the public ip address in Azure (or somewhere) so that it understands that it will be used by a custom domain as well as by an azure subdomain.</p>

<p>I've had a look at the command:</p>

<p>az network </p>

<p>command.  However, it's not very clear is this is the right command to use or not.  Does anyone know how I can make the changes required so that my custom FQDN can be routed properly to my kubernetes cluster?</p>

<p>thanks</p>

ossentoo
<p>Here's the yaml that worked for me.  </p>

<pre><code>apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  name: webapp-ingress
  annotations:
    kubernetes.io/ingress.class: nginx
    certmanager.k8s.io/cluster-issuer: letsencrypt-staging
    nginx.ingress.kubernetes.io/rewrite-target: /
spec:
  tls:
  - hosts:
    - subdomain.eastus2.cloudapp.azure.com
    - subdomain.domain.com
    secretName: tls-secret
  rules:
  - host: subdomain.eastus2.cloudapp.azure.com
    http:
      paths:
      - path: /
        backend:
          serviceName: aks-helloworld
          servicePort: 80
  - host: subdomain.domain.com
    http:
      paths:
      - path: /
        backend:
          serviceName: aks-helloworld
          servicePort: 80
</code></pre>

<p>See here for worked through example: <a href="https://learn.microsoft.com/en-us/azure/aks/ingress" rel="noreferrer">Deploy an HTTPS ingress controller on Azure Kubernetes Service (AKS)</a></p>
