<p>I'm trying to automatically provision a loadbalancer on GCP by using the <code>ingress</code> object with our GKE cluster.</p>

<p>I have three GKE deployments and each is available with a service on port <code>8080</code> with a unique nodePort. </p>

<p>When using <code>ingress-fanout.yaml</code>, it creates 4 backend services instead of the 3 specified in the yaml. The 4th service defaults to all unmatched routes. I assume the 4th service is because we don't match unmapped routes in the yaml. </p>

<p>How can one map unmatched routes to one of the services? Is that possible?</p>

<p>Here's <code>ingress-fanout.yaml</code></p>

<pre><code>apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  name: fanout-ingress
  annotations:
    kubernetes.io/ingress.global-static-ip-name: "our-static-ip"
    ingress.gcp.kubernetes.io/pre-shared-cert: "our-ssl-cert"
    kubernetes.io/ingress.allow-http: "false"
    nginx.ingress.kubernetes.io/force-ssl-redirect: "true"
spec:
  rules:
  - host: our-website.com
    http:
      paths:
      - path: /*
        backend:
          serviceName: li-frontend
          servicePort: 8080
      - path: /backend/*
        backend:
          serviceName: li-django
          servicePort: 8080
      - path: /notifications/*
        backend:
          serviceName: li-notifications
          servicePort: 8080
</code></pre>

<p><strong>Update:</strong> I removed many of the original questions and narrowed the scope of the question. When health checks started succeeding, that cleared the old issues.</p>

<p>First of all, "backends" have nothing to do with the "paths" you specified. "backends" on GCP Console are pointing to your GKE node pools.</p>

<p>Ingress supports adding a default backend. You could have tried just searching for "ingress default backend". You can find documentation about this here: <a href="https://kubernetes.io/docs/concepts/services-networking/ingress/#single-service-ingress" rel="nofollow noreferrer">https://kubernetes.io/docs/concepts/services-networking/ingress/#single-service-ingress</a></p>

<p>Basically doing this will set a default backend when nothing else is matched:</p>

<pre><code>spec:
  backend:
    serviceName: testsvc
    servicePort: 80
rules:
  [...your stuff here...]
</code></pre>
