What is gRPC?
Short answer
gRPC is an RPC framework used for communication between services; it runs over HTTP/2 and encodes messages in binary form with Protocol Buffers (protobuf). The client calls a method in another service as if it were calling a local function; besides a single request-response, it also supports streams from the client, from the server or in both directions. Since it cannot fall back to HTTP/1.1, in TR7 HTTP/2 is required on both sides of the connection: on the HTTP vService, HTTP/2 is selected as the Frontend Protocol, and on the Backend Service, SSL Service is turned on and HTTP 2.0 enabled is selected in the ALPN field, or, for a gRPC server listening on unencrypted HTTP/2 (h2c), SSL Service is left off and Cleartext HTTP/2 (h2c) is checked; the connection that TR7 opens to the Backend Service is HTTP/1.1 by default. If TLS is to be terminated on the gRPC server, passthrough is used with an L7 TCP vService.
Where It Is Used in TR7
| Where | Field / label | What for |
|---|---|---|
| Load Balancer → Load Balancer vService List → HTTP vService form → Frontend | Protocol → Encrypted (HTTPS) → HTTP/2 | HTTP/2 on the client side |
| Load Balancer → Backend Services → Backend Service form | SSL Service, ALPN → HTTP 2.0 enabled (default HTTP 2.0 disabled) | HTTP/2 over TLS on the Backend Service side |
| Load Balancer → Backend Services → Backend Service form | Cleartext HTTP/2 (h2c) (default off; not displayed while SSL Service is checked) | HTTP/2 without TLS on the Backend Service side |
| Load Balancer → Load Balancer vService List → L7 TCP vService form → Frontend | Protocol → TCP | Passing the traffic to the gRPC server without decrypting the TLS (passthrough) |
Step-by-step configuration and verification of both methods: Can I put my gRPC services behind TR7?
Common Misconceptions
- "Making the frontend HTTP/2 is enough." The connection that TR7 opens to the Backend Service is HTTP/1.1 by default; if HTTP 2.0 enabled is not selected in the ALPN field or, for an unencrypted server, Cleartext HTTP/2 (h2c) is not checked, gRPC calls fail.
- "TR7 establishes HTTP/2 to the Backend Service only over TLS." If Cleartext HTTP/2 (h2c) is checked on the Backend Service, TR7 connects to the gRPC server listening on unencrypted HTTP/2 with HTTP/2 without TLS; this setting is effective only on HTTP vServices and while SSL Service is off.
- "There is a health check type specific to gRPC." There is no gRPC among the health check types; the TCP type, which tests the connection, or the TCPS type, which also tests the TLS handshake, is used.
- "The Keep header names action can be used together with gRPC." On a vService that Keep Header Names is bound to, HTTP/2 is turned off and gRPC does not work.
How it is done in the documentation
