Google cloud HTTP load balancer always returns unhealthy instance for meteor app

I am trying to set up an HTTP load balancer for my Meteor app in google cloud. I have configured the application correctly and I know this because I can visit the IP specified in the NLB.

However, when I try to tune an HTTP load balancer, the health checks always say that the instances are unhealthy (although I know they are not). I tried to include a route in my app that returns a 200 status and indicates a health check on that route.

Here's what I did, step by step:

  • Create a new template / instance group for the application.
  • Upload image to Google cloud.
  • Create a replication controller and service for your application.
  • The network load balancer was created automatically. In addition, there are two firewall rules to allow HTTP / HTTPS traffic on all IP addresses.

Then I will try to create an HTTP load balancer. I am creating a backend service in a load balancer with all VMs corresponding to the meteorites application. Then I create a new global forwarding rule. Regardless, the instances are marked as "unhealthy" and the IP from the global forwarding rule returns "Server error".

+3


source to share


1 answer


To use HTTP load balancing on Google Cloud with Kubernetes, you must take a slightly different approach than network load balancing due to the lack of built-in support for HTTP balancing.

I suspect you created your service in step 3 with type: LoadBalancer

. This will not work as expected due to the way the LoadBalancer type will be implemented, which causes the service to only be available on the network address of the network forwarding IP and not on every host IP.



However, in work it will be used type: NodePort

, which will result in reaching the service in the automatically selected port node on each external host IP. This works better with an HTTP load balancer. Then you can pass that node port to the HTTP load balancer you create. When you open the firewall on the port node, you should be kind!

If you need more specific steps, then the GKE documentation actually added a walkthrough recently

+5


source







All Articles