Thomas
Thomas

Reputation: 388

Google Cloud Platform Target Pool HTTPS Health Check

I am attempting to use purely https with my compute engine. I have a network load balancer created that forwards to a pool with my instance in it. However, the pool has constantly failing health checks because it won't let me configure a health check that uses https.

I'm using apache to redirect 80 to 443. Does anyone know how to either create an https health check or have the http health check follow the redirect?

Thanks for any help.

--edit--

I finally came across some documentation at http://googlecloudplatform.blogspot.com/2015/07/Debugging-Health-Checks-in-Load-Balancing-on-Google-Compute-Engine.html.

Failure 5: Not answering directly with a 200 response code The web server may be configured to redirect to a page that returns an HTTP 200 response code. The health check will not follow the redirect; it expects the health check page to return a 200 directly.

This basic capability has been supported at every other hosting provider we've been on. Why can't this be done? What am I missing?

Upvotes: 3

Views: 1937

Answers (1)

kaikun
kaikun

Reputation: 108

I spent the whole day trying to configure a purely https based load balancer in GCloud for a Kubernetes cluster with an ingress controller.

I finally got it working, so maybe I share my experience with people that struggle with the same configuration. If the health-check fails for the instances you will usually see the following accessing your websites URL.

Error: Server Error
The server encountered a temporary error and could not complete your request.

Please try again in 30 seconds.

1) Protocol: GCloud introduced new health checks which can be configured for HTTPS, SSLTCP, SSL, HTTP, HTTPS, or HTTP/2 probing. This can help the original problem to prevent a redirect from port 80 to port 443.

2) Path: The most common issue is a that the "/" path of your application will not return a 200 OK and thus let the health issue fail. This can be prevented by adding a path argument to your health check e.g. "/index".

3) Ingress HTTPS: This is relatively simple. Adding a secret or a pre-shared-cert to your ingress.yaml will automatically result in an HTTPS Load Balancer instead of HTTP. Further information to follow are here

Lastly, the guide from the docs for Setting up HTTP Load Balancing with Ingress .

However, even though the new HTTPS Health checks seem to work, they are still in the beta phase and bugs are reported in the issue tracker. The documentation for the gcloud-ingress-controller can be found here.

Upvotes: 1

Related Questions