Kubernetes ingress on GKE results in 502 response on http / SSL_ERROR_SYSCALL on https

6/13/2019

I've tested my configuration on minikube where it works perfectly, however on GKE I run into an error of HTTP responding with 502 while the HTTPS gets the connection terminated?

I have no idea how to diagnose this issue, which logs could I look at?

Here is a verbose curl log when accessing over https://

* Expire in 0 ms for 1 (transfer 0x1deb470)
* Expire in 0 ms for 1 (transfer 0x1deb470)
* Expire in 0 ms for 1 (transfer 0x1deb470)
*   Trying 35.244.154.110...
* TCP_NODELAY set
* Expire in 200 ms for 4 (transfer 0x1deb470)
* Connected to chrischrisexample.de (35.244.154.110) port 443 (#0)
* ALPN, offering h2
* ALPN, offering http/1.1
* Cipher selection: ALL:!EXPORT:!EXPORT40:!EXPORT56:!aNULL:!LOW:!RC4:@STRENGTH
* TLSv1.2 (OUT), TLS header, Certificate Status (22):
* TLSv1.2 (OUT), TLS handshake, Client hello (1):
* OpenSSL SSL_connect: SSL_ERROR_SYSCALL in connection to chrischrisexample.de:443 
* Closing connection 0
curl: (35) OpenSSL SSL_connect: SSL_ERROR_SYSCALL in connection to chrischrisexample.de:443 
-- Chris Stryczynski
google-cloud-platform
google-kubernetes-engine

1 Answer

6/13/2019

To solve it I had to:

  • Respond with a HTTP 200 on the health check (from the Google load balancer!)
  • Set a SSL certificate secret in the ingress (even if a self signed one)

Events:
  Type     Reason     Age                     From                     Message
  ----     ------     ----                    ----                     -------
  Warning  Sync       14m (x20 over 157m)     loadbalancer-controller  Could not find TLS certificates. Continuing setup for the load balancer to serve HTTP. Note: this behavior is deprecated and will be removed in a future version of ingress-gce
  Warning  Translate  3m56s (x18 over 9m24s)  loadbalancer-controller  error while evaluating the ingress spec: could not find port "80" in service "default/app"; could not find port "80" in service "default/app"; could not find port "80" in service "default/app"; could not find port "80" in service "default/app"

These errors were shown on the kubectl describe ingress... Still doesn't make sense why it would error on the SSL handshake / connection though.

-- Chris Stryczynski
Source: StackOverflow