<p>I am trying to set up a HTTP load balancer for my Meteor app on google cloud. I have the application set up correctly, and I know this because I can visit the IP given in the Network Load Balancer.</p>

<p>However, when I try and set up a HTTP load balancer, the health checks always say that the instances are unhealthy (even though I know they are not). I tried including a route in my application that returns a status 200, and pointing the health check towards that route.</p>

<p>Here is exactly what I did, step by step:</p>

<ol>
<li>Create new instance template/group for the app. </li>
<li>Upload image to google cloud.</li>
<li>Create replication controller and service for the app.</li>
<li>The network load balancer was created automatically. Additionally, there were two firewall rules allowing HTTP/HTTPS traffic on all IPs.</li>
</ol>

<p>Then I try and create the HTTP load balancer. I create a backend service in the load balancer with all the VMs corresponding to the meteor app. Then I create a new global forwarding rule. No matter what, the instances are labelled "unhealthy" and the IP from the global forwarding rule returns a "Server Error".</p>

<p>In order to use HTTP load balancing on Google Cloud with Kubernetes, you have to take a slightly different approach than for network load balancing, due to the current lack of built-in support for HTTP balancing.</p>

<p>I suspect you created your service in step 3 with <code>type: LoadBalancer</code>. This won't work properly because of how the LoadBalancer type is implemented, which causes the service to be available only on the network forwarding rule's IP address, rather than on each host's IP address.</p>

<p>What will work, however, is using <code>type: NodePort</code>, which will cause the service to be reachable on the automatically-chosen node port on each host's external IP address. This plays more nicely with the HTTP load balancer. You can then pass this node port to the HTTP load balancer that you create. Once you open up a firewall on the node port, you should be good to go!</p>

<p>If you want more concrete steps, a <a href="https://cloud.google.com/container-engine/docs/tutorials/http-balancer" rel="noreferrer">walkthrough of how to use HTTP load balancers</a> with Container Engine was actually recently added to GKE's documentation. The same steps should work with normal Kubernetes.</p>

<p>As a final note, now that version 1.0 is out the door, the team is getting back to adding some missing features, including native support for L7 load balancing. We hope to make it much easier for you soon!</p>
