TLS handshake fails intermittently when using HAProxy Ingress Controller TLS handshake fails intermittently when using HAProxy Ingress Controller kubernetes kubernetes

TLS handshake fails intermittently when using HAProxy Ingress Controller


HAProxy by default allows to reuse the same port number across the same or other frontend/listen sections and also across other haproxy process. This can be changed adding noreuseport in the global section.

The default HAProxy Ingress configuration uses port number 1936 to expose stats. If such port number is reused by eg a tcp proxy, the incoming requests will be distributed between both frontends - sometimes your service will be called, sometimes the stats page. Changing the tcp proxy or the stats page (doc here) to another port should solve the issue.