<p>I am trying to run a mlflow server on Azure Kubernetes. I can access the server when attaching service to deployment as a Load Balancer. However, when I am trying to access the server using ingress it can't access it. However, when running the ingress public IP on port 80 I get Nginx server error <code>404 not found</code>, which is expected but when running on mlflow server 5000 it is timed out.</p>
<p>Below are the manifest files for the deployment, Load Balancer service and Ingress.</p>
<p><strong>Deployment:</strong></p>
<pre><code>    apiVersion: apps/v1
    kind: Deployment
    metadata:
      name: mlflow-deployment
      labels:
        app: mlflow
    spec:
      selector:
        matchLabels:
          app: mlflow
      replicas: 1
      template:
        metadata:
          labels:
            app: mlflow
        spec:
          containers:
            - name: mlflow
              image: rjtshrm/mlflow:latest
              args: [&quot;--backend-store-uri&quot;, &quot;postgresql://psql:_Reply2022@mlflopgsql.postgres.database.azure.com:5432/postgres?sslmode=require&quot;, &quot;--default-artifact-root&quot;, &quot;wasbs://mlflow@mlflowsmodeltorage.blob.core.windows.net&quot;, &quot;--host&quot;, &quot;0.0.0.0&quot;]
              ports:
                - containerPort: 5000
</code></pre>
<p><strong>Service: Load Balancer</strong></p>
<pre><code>    apiVersion: v1
    kind: Service
    metadata:
      name: mlflow
      labels:
        app: mlflow
    spec:
      selector:
        app: mlflow
      type: LoadBalancer
      ports:
        - port: 5000
          targetPort: 5000
</code></pre>
<p><strong>Ingress:</strong></p>
<pre><code>    apiVersion: networking.k8s.io/v1
    kind: Ingress
    metadata:
      name: mlflow-server-ingress
      annotations:
        nginx.ingress.kubernetes.io/ssl-redirect: &quot;false&quot;
        nginx.ingress.kubernetes.io/use-regex: &quot;true&quot;
        nginx.ingress.kubernetes.io/rewrite-target: /$2
    spec:
      ingressClassName: mlflow-server-ingress
      rules:
        - http:
            paths:
              - path: /(.*)
                pathType: Prefix
                backend:
                  service:
                    name: mlflow
                    port:
                      number: 5000
</code></pre>
<p>Also, to install the Ingress controller I did the steps below.</p>
<pre><code>    helm repo add ingress-nginx https://kubernetes.github.io/ingress-nginx
    helm repo update
    helm install ingress-nginx ingress-nginx/ingress-nginx  --namespace default   --set controller.service.annotations.&quot;service\.beta\.kubernetes\.io/azure-load-balancer-health-probe-request-path&quot;=/healthz
</code></pre>
<p>Below it can be seen the services running in default namespace. The ingress-nginx-controller has a public IP which I can access on port 80 and get this error message <code>404 not found</code>. Then for the Load Balancer, I can access the server with external IP on port 5000.
<a href="https://i.stack.imgur.com/e1XU0.png" rel="nofollow noreferrer">Can be seen in the image</a></p>
<p>After applying the Ingress yaml file when I'm trying to access the ingress-nginx-controller on port 5000, the site can't be reached. the logs of ingress-nginx-controller <a href="https://i.stack.imgur.com/hsNmm.png" rel="nofollow noreferrer">here</a></p>
<p>PS: I have added the image and its args in the deployment file. It is public image with test Database credentials so that the whole thing can be tested.</p>

Rajat
<p>Is your <code>.spec.ingressClassName</code> field correct? I see you deployed nginx ingress controller.</p>
