kuberhealthy

A Kubernetes operator for running synthetic checks as pods. Works great with Prometheus!

View the Project on GitHub kuberhealthy/kuberhealthy

client-js

This is a JavaScript client for Kuberhealthy external checks. This client exports functions for sending status report POST requests to Kuberhealthy. This is a JavaScript implementation of the Go client found here. More documentation on external checks can be found here.

NPM:

The kuberhealthy NPM package is conformant with the reference sample syntax but also supports async/await as well as arbitrary host and port.

Usage

Download the client into your JavaScript project by navigating to your project directory and downloading the client file:

cd my-kh-check
curl -O -L https://raw.githubusercontent.com/kuberhealthy/kuberhealthy/master/clients/js/kh-client.js

In your project, require the file you just downloaded:

const kh = require("./kh-client");

Then you can report check status to Kuberhealthy using ReportSuccess() or ReportFailure():

// Report failure. 
kh.ReportFailure(["example failure message"]);

// Report success.
kh.ReportSuccess();
Example Use
try {
    kh.ReportSuccess();
} catch (err) {
    console.error("Error when reporting success: " + err.message);
    process.exit(1);
}
process.exit(0);
Example Check

There is an example check in this directory.