Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

kubernetes-probes

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

kubernetes-probes - npm Package Compare versions

Comparing version 0.1.1 to 0.1.2

kubernetes-probes-0.1.2.tgz

2

package.json
{
"name": "kubernetes-probes",
"version": "0.1.1",
"version": "0.1.2",
"description": "Listener for health probes from kubernetes.",

@@ -5,0 +5,0 @@ "private": false,

# kubernetes-probes
Library for an express listener on specified port to expose an http probe endpoint that kubelet can use to check container status.
Both readiness and liveness probes are supported.
This library supports a model whereby an app could have several asynchronous aspects that define readiness or liveness.
You define one or more functions for each aspect of readiness or liveness.
When probed (readiness or liveness), kubernetes-probes calls the appropriate one or more defined functions.
Use of this library infers your app is implementing both (all) probes.
If kubernetes-probes gets a probe and there are no functions defined for that type of probe, the response will be negative, i.e., a status code of 200.
This will indicate to kubernetes that the app is not ready/lively.
## Usage
In this examplet here is one liveness function and two readiness functions.
```javascript
var k8sProbes = require('kubernetes-probes');
k8sProbes.addReadinessFunction(alive);
k8sProbes.addLivenessFunction(ready);
k8sProbes.addReadinessFunction(alive, "ready 1");
k8sProbes.addReadinessFunction(alive, "ready 2");
k8sProbes.listen(80);
//
// Readiness function
var ready = function(cb) {
cb(true, "I am ready.");
};
//
// Liveness function

@@ -21,2 +26,12 @@ var alive = function(cb) {

};
//
// Readiness function #1
var ready1 = function(cb) {
cb(true, "I am ready.");
};
//
// Readiness function #2
var ready2 = function(cb) {
cb(true, "I am ready.");
};
```

@@ -26,2 +41,3 @@

* Express
* Async

@@ -28,0 +44,0 @@ ## API

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc