title: How grpc-health-probe (gRPC health checking on Kubernetes) differentiates between liveness and readiness probes
body: <p>I am writing one grpc service and using gRPC health checking on Kubernetes (<a href="https://github.com/grpc-ecosystem/grpc-health-probe" rel="nofollow noreferrer">https://github.com/grpc-ecosystem/grpc-health-probe</a>). In my server, I added different implementation (one for liveness and other for readiness) of endpoints. I am wondering how this probe utility binary differentiates between liveness check vs readiness check? There should be some other way to define it in yaml, not just
  ["bin/grpc_health_probe", "-addr=:8801"]</p>
  
  <pre><code>server = ServerBuilder.forPort(port)
    .addService(new GrpcModuleHealthCheck())
    .addService(new GrpcModuleReadinessCheck())
    .addService(ProtoReflectionService.newInstance())
    .build.start
  </code></pre>
  
  <p>In kubernetes deployment yaml, I am using below configurations</p>
  
  <pre><code>    livenessProbe:
        failureThreshold: 3
        exec:
          command: ["bin/grpc_health_probe", "-addr=:8801"]
        initialDelaySeconds: 240
        periodSeconds: 20
        successThreshold: 1
        timeoutSeconds: 15
      readinessProbe:
        failureThreshold: 3
        exec:
          command: ["bin/grpc_health_probe", "-addr=:8801"]
        initialDelaySeconds: 20
        periodSeconds: 20
        successThreshold: 1
        timeoutSeconds: 15
  </code></pre>
  
  <p>I just tested and found "GrpcModuleReadinessCheck" (the health class which I added last) implementation is taking effect when I just exec my kubernetes pod</p>
  
  <pre><code>kubectl exec -it &lt;MY_POD_NAME&gt; -- /bin/bash
  
  bash-4.4$ ./grpc_health_probe -addr=localhost:8801
  status: SERVING
  </code></pre>