<h2>Ingress</h2>

<pre><code>apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  name: assortment-ingress
  annotations:
    kubernetes.io/ingress.class: nginx
    nginx.ingress.kubernetes.io/rewrite-target: /
spec:
  tls:
  - hosts:
    - myapp.centralus.cloudapp.azure.com
    secretName: aks-ingress-tls
  rules:
  - host: myapp.centralus.cloudapp.azure.com
    http:
      paths:
      - path: /my-service
        backend:
          serviceName: my-backend
          servicePort: 80
</code></pre>

<p>deployment &amp; service</p>

<pre><code>apiVersion: apps/v1beta1
kind: Deployment
metadata:
  name: my-deployment
spec:
  replicas: 1
  template:
    metadata:
      labels:
        app: myservice
    spec:
      containers:
      - name: myservice
        image: myreg.azurecr.io/my-latest
        imagePullPolicy: Always
        ports:
           - name: http
             containerPort: 8080
      imagePullSecrets:
      - name: my-auth

apiVersion: v1
kind: Service
metadata:
 name: my-backend
spec:
 type: ClusterIP
 selector:
   app: myservice
 ports:
  - name: http
    protocol: TCP
    port: 80
    targetPort: 8080
</code></pre>

<p>However </p>

<pre><code>curl https://myapp.centralus.cloudapp.azure.com/my-service
</code></pre>

<p>gives </p>

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

<p>Note myapp.centralus.cloudapp.azure.com already resolves to the ingress controller's public IP</p>

<p>When I create a service with type LoadBalancer with same config, it works with public api.</p>

Neil
<p>First of all check your pods are in running state. </p>

<p>or</p>

<p>maybe cause of redirection of too many ports from 80 to 8080.ingress to service to target port. </p>

<p>your config is absolutely right it is simple problem may be pod not running or wait for some time to with clear cache of browser.</p>
