My apologies for not clarifying this earlier. Consul health checks are run within the context of the agent that is executing them. Script checks, like the one you provided, will be run by the Consul client/server agent.
If you want to run a health check against your pod, you need to configure a network-level health check (i.e., TCP, HTTP, gRPC, etc) so that the agent can communicate with your target service.
Hi @blake
Let me know if I understood correctly.
if I am trying to register a grpc service running in a pod having checks as [“/bin/grpc_health_probe”,“-addr=:50051”] Consul client can’t perform health check on it?
Second, I have to make my server expose an grpc health check endpoint on a port, like we do for http on “/health” endpoint and return a 200 response?
The other person was attempting to configure a script check for their service, with the script residing inside of their application pod instead of in a location that was accessible to the Consul agent.
The health check can be exposed on the same port as your normal service, or a separate port. The check does need to return an 200 response to be considered healthy.