https://github.com/kool-dev/healthz
Utility to simplify health check applications.
https://github.com/kool-dev/healthz
Last synced: 7 months ago
JSON representation
Utility to simplify health check applications.
- Host: GitHub
- URL: https://github.com/kool-dev/healthz
- Owner: kool-dev
- License: mit
- Created: 2020-11-23T21:20:47.000Z (almost 5 years ago)
- Default Branch: main
- Last Pushed: 2021-01-16T13:33:58.000Z (almost 5 years ago)
- Last Synced: 2025-03-24T05:43:43.601Z (8 months ago)
- Language: Go
- Homepage:
- Size: 38.1 KB
- Stars: 4
- Watchers: 2
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# healthz
[](https://kool.dev)
Utility to simplify health check on container applications.
---
[](https://goreportcard.com/report/github.com/kool-dev/healthz)
[](https://codecov.io/gh/kool-dev/healthz)
[](https://codeclimate.com/github/kool-dev/healthz/maintainability)
[
](https://join.slack.com/t/kool-dev/shared_invite/zt-jeh36s5g-kVFHUsyLjFENUUH4ucrxPg)
### Installation
`healthz` is available with a one-line install script for Linux:
```bash
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.
```bash
# 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:
```Dockerfile
COPY --from=kooldev/healthz /healthz /healthz
```
Running it with Docker:
```console
$ docker run --rm kooldev/healthz:1.0 -i "..."
```
## License
The MIT License (MIT). Please see [License File](LICENSE.md) for more information.