Curl to a application hosted on kuberetes returns 502 Bad Gateway

10/15/2018
curl -v -k https://xxxx.yyyy.zzzz.pp/
*   Trying 143.204.181.115...
* Connected to xxxx.domain.name.something (143.204.181.115) port 443 (#0)
* SSL peer handshake failed, the server most likely requires a client certificate to connect
* Closing connection 0
curl: (35) SSL peer handshake failed, the server most likely requires a client certificate to connect
-- Avi
kubernetes
kubernetes-ingress
nginx

1 Answer

10/16/2018

Its to do with the ingress controller setup which is load balancing requests to the application's ingress . The issue occurs if the ingress's annotation spec is not in the right format i.e.

    nginx.ingress.kubernetes.io/secure-backends - if the nginx ingress controller is setup using the chart https://github.com/kubernetes/ingress-nginx

    ingress.kubernetes.io/secure-backends - if the nginx ingress controller is setup using the KOPS https://github.com/kubernetes/kops/tree/master/addons/ingress-nginx

The 'nginx.' from the annotations had to be removed which resolved the 502 Bad Gateway error when hitting the application URL.

-- Avi
Source: StackOverflow