1.0.2 • Published 6 years ago

k8s-probes v1.0.2

Weekly downloads
-
License
ISC
Repository
-
Last release
6 years ago

k8s-probes

This repo offers an helper to expose an http probe endpoint that kubelet can use to check container status: https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-probes/#reference

At the moment we only implement readiness prob

Readiness Probe

Spin up an http server that expose an endpoint that when is up always return 200

const port = 9999;
const path = '/ready';
// initialize the prober server on custom port
const prober = require(k8s-probe)({port});

// do your own service async initialization in here
// ...
// once your service is ready just call the probe to expose the endpoint
prober.isReady({path})

CONFIGURATION

The readiness probe support the following configs:

  • port : The port where the server listen for readiness probes, default to 9999
  • path : The path where the server listen for readiness probes, default to /_ready

ENVIRONMENT VARIABLE

ENV VARIABLE NAMEDescription
K8S_PROBES_DISABLEDisable the probe server completely, useful when developing to avoid port collision
1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago