Hey everyone,
I have a gRPC service running on Fly and want to implement a proper health check. I’ve already implemented the official gRPC Health Checking Protocol ( Health Checking | gRPC ) in my app and added the grpc_health_probe ( GitHub - grpc-ecosystem/grpc-health-probe: A command-line tool to perform health-checks for gRPC applications in Kubernetes and elsewhere ) binary to my Dockerfile.
I initially tried using [[services.machine_checks]] to run the probe (doesn’t work because localhost is wrong):
toml
[[services.machine_checks]]
command = ["/bin/grpc_health_probe", "-addr=localhost:50051"]
interval = "10s"
timeout = "2s"
grace_period = "30s"
However, as I understand it, machine_checks are primarily for pre-deployment/canary testing and don’t seem to provide continuous runtime health signals for the proxy to pull unhealthy machines out of rotation.
My question:
-
Is there a way to run a custom binary like
grpc_health_probeas a standard runtime check (similar to Kubernetesexecprobes)? -
If not, what is the recommended pattern to run health checks for gRPC services?
Greetings, Kalle!