<p>I deployed two services in a cluster in google cloud.</p>

<p>When I run: <code>kubectl get services</code> I get-></p>

<pre><code>NAME           TYPE        CLUSTER-IP     EXTERNAL-IP   PORT(S)          AGE
hello-java-1   NodePort    10.7.254.204   &lt;none&gt;        8080:31848/TCP   21m
hello-java-2   NodePort    10.7.246.52    &lt;none&gt;        8080:30624/TCP   19m
kubernetes     ClusterIP   10.7.240.1     &lt;none&gt;        443/TCP          23m
</code></pre>

<p>Now, I followed as per google cloud docs: <a href="https://cloud.google.com/kubernetes-engine/docs/tutorials/http-balancer" rel="nofollow noreferrer">Ingress</a> and configured the fanout-ingress as:</p>

<pre><code>apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  name: fanout-ingress
spec:
  rules:
  - http:
      paths:
      - path: /product/*
        backend:
          serviceName: hello-java-1
          servicePort: 8080
      - path: /list/*
        backend:
          serviceName: hello-java-2
          servicePort: 8080
</code></pre>

<p>Now:</p>

<pre><code>$kubectl get ingress fanout-ingress
NAME             HOSTS     ADDRESS         PORTS     AGE
fanout-ingress   *         35.190.55.204   80        17m
</code></pre>

<p>I get these results.</p>

<p>I checked the command: <code>kubectl describe ingress fanout-ingress</code></p>

<p>The output is:</p>

<pre><code>  *
        /product/*   hello-java-1:8080 (&lt;none&gt;)
        /list/*      hello-java-2:8080 (&lt;none&gt;)
Annotations:
  ingress.kubernetes.io/backends:         {"k8s-be-30624--e761000d52fd1c80":"HEALTHY","k8s-be-31726--e761000d52fd1c80":"HEALTHY","k8s-be-31848--e761000d52fd1c80":"HEALTHY"}
  ingress.kubernetes.io/forwarding-rule:  k8s-fw-default-fanout-ingress--e761000d52fd1c80
  ingress.kubernetes.io/target-proxy:     k8s-tp-default-fanout-ingress--e761000d52fd1c80
  ingress.kubernetes.io/url-map:          k8s-um-default-fanout-ingress--e761000d52fd1c80
Events:
  Type    Reason   Age               From                     Message
  ----    ------   ----              ----                     -------
  Normal  ADD      18m               loadbalancer-controller  default/fanout-ingress
  Normal  CREATE   17m               loadbalancer-controller  ip: 35.190.55.204
  Normal  Service  8m (x4 over 17m)  loadbalancer-controller  no user specified default backend, using system default
</code></pre>

<p><strong>Now when I access <code>http://35.190.55.204/product/home</code> I get spring whitelabel error.. but \home is defined in the application! Why this happens?</strong></p>

<p>I got the issue! For the path to be <code>/product/*</code>, <strong>all the URL mappings of our first service</strong> Requestpath in spring application should start with <code>/product/</code></p>

<blockquote>
  <p>ex: /product/list, /product/add, /product/delete etc</p>
</blockquote>

<p>Also for Ingress path rule /list/*, <strong>all the URL mappings in our second service</strong> Requestpath in spring application should start with <code>/list/</code></p>

<blockquote>
  <p>ex: /list/sort, /list/add, /list/delete etc</p>
</blockquote>
