Skip to content

Commit

Permalink
Merge pull request #452 from Comcast/doc-update
Browse files Browse the repository at this point in the history
update external check docs with deadline
  • Loading branch information
Eric Greer committed May 14, 2020
2 parents 1fb4150 + 5cb6854 commit 387bc30
Showing 1 changed file with 8 additions and 2 deletions.
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

0 comments on commit 387bc30

Please sign in to comment.