Skip to content

Latest commit

 

History

History
57 lines (36 loc) · 1.91 KB

README.md

File metadata and controls

57 lines (36 loc) · 1.91 KB

healthz

Kool.dev

Utility to simplify health check on container applications.


Go Report Card codecov Maintainability

Installation

healthz is available with a one-line install script for Linux:

curl -fsSL https://raw.githubusercontent.com/kool-dev/healthz/main/install.sh | bash

Usage

healthz receives a JSON array as parameter, which contains all tests it needs to perform.

After executing all the checks, it will exit with with 0 exit code for success, and non-zero otherwise.

# check for a TCP listening port to accept connections
healthz -i '[{"type": "tcp", "value": "localhost:80"}]'

# check for an HTTP server to respond with a 200 status code
healthz -i '[{"type": "http", "value": "http://localhost"}]'

# execute a command and check for exit code to be zero
healthz -i '[{"type": "exec", "value": "ls -lah /"}]'

Docker image

We also provide a single binary Docker image with healthz. The image can be used to fetch the binary easily on other images you want to add health check to.

Adding it to your own images:

COPY --from=kooldev/healthz /healthz /healthz

Running it with Docker:

$ docker run --rm kooldev/healthz:1.0 -i "..."

License

The MIT License (MIT). Please see License File for more information.