For those deploying gRPC servers to Kubernetes, I am looking for community feedback about having native health checks in gRPC. (This is currently discussed in issue #21493.)
Questions I have for you:
Do you use Kubernetes readiness/liveness probes features on your gRPC server?
If so, what kind of probe you use? (There are plenty of methods to choose from, like shipping a client in the container image and use the exec probe)
Are you aware of gRPC Health Check Protocol? If not, would you consider refactoring your application to implement this rpc Check() to get a Kubernetes-native health checking for gRPC servers?
we have probe endpoints defined in the app. Liveness just returns 200 when everything is up and running, Readiness checks connection to the database as well.
We are using grpc with grpc-gateway, so there are endpoints for /liveness and /readiness, then when container (app server) is running, status code 200 is returned. The grpc-gateway lives in a different container in the same pod.
grpc_health_probe gives you a command-line tool to ping gRPC servers, as long as they implement the standard health-checking protocol. You can use this with Kubernetes liveness/readiness “exec” probes.
I’ll be writing a blog post about this on gRPC or Kubernetes blog soon.