Usage
Description
By default, the gRPC endpoint will be checked using the gRPC healthcheck protocol. This is usually sufficient for most cases as the Cerbos REST API is built on top of the gRPC API. When a Cerbos config file path is provided via--config or the CERBOS_CONFIG environment variable, the healthcheck will be automatically configured based on the settings from the file.
Flags
Configuration Mode
Path to Cerbos config file. When provided, healthcheck settings are read from the config file.Environment variable:
CERBOS_CONFIGManual Configuration Mode
Host and port to connect to (e.g.,
127.0.0.1:3593)Environment variable: CERBOS_HC_HOSTPORTPath to CA certificate for validating server certificateEnvironment variable:
CERBOS_HC_CACERTDon’t use TLS when connectingEnvironment variable:
CERBOS_HC_NOTLSCommon Flags
Healthcheck kind:
grpc or httpEnvironment variable: CERBOS_HC_KINDDo not verify server certificateEnvironment variable:
CERBOS_HC_INSECUREHealthcheck timeout durationEnvironment variable:
CERBOS_HC_TIMEOUTExamples
Check gRPC endpoint with config file
Check HTTP endpoint ignoring certificate verification
Check HTTP endpoint without TLS
Docker healthcheck
In your Dockerfile:Kubernetes liveness probe
Exit Codes
- 0: Healthcheck passed
- 1: Healthcheck failed
Default Endpoints
- gRPC:
127.0.0.1:3593 - HTTP:
127.0.0.1:3592
Notes
The gRPC healthcheck is the recommended method as it uses the standard gRPC health checking protocol and provides accurate status information.