How to configure haproxy-ingress for serving GRPC How to configure haproxy-ingress for serving GRPC kubernetes kubernetes

How to configure haproxy-ingress for serving GRPC


gRPC works on top of h2 and, for compatibility reasons, client and server need to agree about the http protocol version they want to speak. In haproxy this is done using alpn keyword in the bind line, which only works on TLS connections. By default HAProxy Ingress configures alpn with h2,http1.1, allowing h2 and gRPC out of the box in the client side - but only on https connections.

If you're using plain http, client and server doesn't have a way to agree about a protocol, and the default version used is http1. You can overwrite this behavior configuring bind-http with :80 proto h2 but this should break http1 clients.