Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update external check docs with deadline #452

Merged
merged 6 commits into from
May 14, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 8 additions & 2 deletions docs/EXTERNAL_CHECK_CREATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@ Your check only needs to do a few things:

- Read the `KH_REPORTING_URL` environment variable.
- Send a `POST` to the `KH_REPORTING_URL` with the following JSON body:
- Ensure that your check finishes running before the unix time specified in the `KH_CHECK_RUN_DEADLINE` environment variable occurs. (Optional)
- This is optional, but by respecting `KH_CHECK_RUN_DEADLINE` means you won't have an unexpected `400` returned from Kuberhealthy when reporting your check's status.
- Ensure that your check finishes within the [unixtime](https://en.wikipedia.org/wiki/Unix_time) deadline specified in the `KH_CHECK_RUN_DEADLINE` environment variable. If `KH_CHECK_RUN_DEADLINE` is not respected, your check may run into a `400` error when reporting its state to Kuberhealthy.

```json
{
Expand All @@ -41,6 +40,13 @@ Simply build your program into a container, `docker push` it to somewhere your c

Clients outside of Go can be found in the [clients directory](../clients).

#### Injected Check Pod Environment Variables
The following environment variables are injected into every checker pod that Kuberhealthy runs. When writing your checker code, you can depend on these environment variables always being available to you, even if you do not specify them in your `khcheck` spec.
```
KH_REPORTING_URL: The Kuberhealthy URL to send POST requests to for check statuses.
KH_CHECK_RUN_DEADLINE: The Kuberhealthy-calculated deadline for checks given in unix.
```

### Creating Your `khcheck` Resource

Every check needs a `khcheck` to enable and configure it. As soon as this resource is applied to the cluster, Kuberhealthy will begin running your check. Whenever you make a change, Kuberhealthy will automatically re-load the check and restart any checks currently in progress gracefully.
Expand Down