Skip to content
This repository was archived by the owner on Jul 29, 2021. It is now read-only.

Simple liveness and readiness check middleware for openshift/kubernetes

License

Notifications You must be signed in to change notification settings

nodeshift-archived/kube-probe

Folders and files

NameName
Last commit message
Last commit date

Latest commit

dc9c398 · Jul 28, 2021
May 25, 2021
Oct 22, 2020
Oct 22, 2020
Oct 22, 2020
Aug 7, 2017
Jul 28, 2021
Nov 13, 2018
Aug 10, 2017
Jul 28, 2021
Apr 22, 2020
Jul 28, 2021
Nov 13, 2020
Jul 28, 2021

Repository files navigation

This module is deprecated.

Build Status Coverage Status Greenkeeper badge Connect middleware that sets up generic liveness and readiness probes for OpenShift/Kubernetes

Example Usage:

const express = require('express');
const app = express();

const probe = require('kube-probe');

probe(app);

This will add 2 GET endpoints /api/health/liveness and /api/health/readiness that will return a 200 OK response. This module uses overload-protection to identify when a process may be overloaded, and will return HTTP 503 Service Unavailable if the service becomes too heavily loaded. Configuration of the protection-config module may be passed as options.protectionConfig.

See: https://github.com/davidmarkclements/overload-protection/

Parameters

  • app - an instance of a connect-based framework (e.g. express.js) - required

  • options - optional

  • options.readinessURL - string - url where the readiness probe is located

  • options.livenessURL - string - url where the livenessURL probe is located

  • options.readinessCallback - function - function to call when the readiness probe is triggered

  • options.livenessCallback - function - function to call when the liveness probe is triggered

  • options.bypassProtection - boolean - kube-probe will bypass protection (defaults to false)

  • options.protectionConfig - object - options passed direction to overload-protection

Environment Variables

  • KUBE_PROBE_BYPASS_PROTECTION - boolean - kube-probe will bypass protection