<p>I am trying to setting up a load balance on kubernetes on GCP and got stucked now.
So I was following this tutorial (<a href="https://cloud.google.com/kubernetes-engine/docs/tutorials/http-balancer" rel="nofollow noreferrer">Tutorial</a>) but I can't get past <strong>Step 6: (Optional) Serve multiple applications on a load balancer</strong></p>

<p>I am using a node simple app that only prints a name from a config map.
After following every step my paths can not be found (404).</p>

<p>This is my deployment example (both my services uses "the same" deployment, only changing names and image): </p>

<pre><code>kind: Deployment
metadata:
  name: nodetestfoo
  namespace: default
spec:
  selector:
    matchLabels:
      run: nodetestfoo
  template:
    metadata:
      labels:
        run: nodetestfoo
    spec:
      containers:
      - image: gcr.io/e3-dev-227917/nodetestfoo:v4
        imagePullPolicy: IfNotPresent
        name: nodetestfoo
        ports:
        - containerPort: 3333
          protocol: TCP
        envFrom:
          - configMapRef:
              name: env-config
---
apiVersion: v1
kind: Service
metadata:
  name: nodetestfoo
  namespace: default
spec:
  ports:
  - port: 3333
    protocol: TCP
    targetPort: 3333
  selector:
    run: nodetestfoo
  type: NodePort
</code></pre>

<p>This is my ingress:</p>

<pre><code>apiVersion: networking.k8s.io/v1beta1
kind: Ingress
metadata:
  name: api-ingress
spec:
  rules:
  - http:
      paths:
      - path: /test
        backend:
          serviceName: nodetest
          servicePort: 3333
      - path: /foo
        backend:
          serviceName: nodetestfoo
          servicePort: 3333
</code></pre>

<p>My kubectl describe ingress output:
<a href="https://i.stack.imgur.com/PMe1V.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/PMe1V.png" alt="enter image description here"></a></p>

<p>The response of a request using a path
<a href="https://i.stack.imgur.com/WL5RZ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/WL5RZ.png" alt="enter image description here"></a></p>

<p>The response of a request without a path (this default back-end really does not exists, so I believe it's the expected behavior)
<a href="https://i.stack.imgur.com/RPtS1.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/RPtS1.png" alt="enter image description here"></a></p>

<p>What should I do to make it work? I'm kinda lost here. (obviously I'm new to cloud, in the beginning of my studies)</p>

<p>Let me tell you what you did. You got a functional configuration, but didn't give it enough time to deploy the load balancer. It usually takes about 5 minutes to have a functional <code>http</code> load balancer. But you probably got anxious, and never let it to get fully configured. So, just get back to your original <code>Ingress</code>, create it, and wait. after like 5 minutes, curl it.</p>

<p>You are saying "I had to add this annotation...". By adding that annotation, you switched to a different Ingress Controller (which you had to install previously). Nginx Ingress Controller takes milliseconds to get ready, as is just has to update nginx server config file. Also the traffic goes through a <code>tcp</code> load balancer, which gets ready very quick too, to the Ingress Controller, which is a pod. So here you have a load balancer that gets ready in about 30 seconds, therefor it seems that it works, while the other one doesn't.</p>

<p>Now, I am telling this because you seem to be a little confused about what happened,  not because I'm advising getting back to GKE Ingress Controller. You still might want to stick to nginx Ingress Controller. It is reliable. I personally like it more then GKE, for several reasons. Or you might end up with any other. There are tens of Ingress Controllers now out there. </p>
