Health Check#

Once a Flow is running, you can use jina ping CLI to run a health check of the complete Flow or of individual Executors or Gateway.

Start a Flow in Python:

from jina import Flow

with Flow(protocol='grpc', port=12345).add(port=12346) as f:

Check the readiness of the Flow:

jina ping flow grpc://localhost:12345

You can also check the readiness of an Executor:

jina ping executor localhost:12346

…or the readiness of the Gateway service:

jina ping gateway  grpc://localhost:12345

When these commands succeed, you should see something like:

INFO   [email protected] readiness check succeeded 1 times!!! 

Use in Kubernetes

The CLI exits with code 1 when the readiness check is not successful, which makes it a good choice to be used as readinessProbe for Executor and Gateway when deployed in Kubernetes.