k8s-watch-rx
TypeScript icon, indicating that this package has built-in type declarations

0.3.4 • Public • Published

k8s-watch-rx

Simple Observable wrapper for kubernetes-client k8s.watch

Note:

This is currently a very basic library. There is no support for any special kubernetes configuration. All is loaded from the default config of the current runtime environment.

Basic usage example:

import { watchKubeResourceRx } from "k8s-watch-rx"; 
import { V1ConfigMap } from "@kubernetes/client-node";

const namespace='default';
const configMapName='some-config-map';

// watch a configmap in default namesapce
const watch = watchKubeResourceRx<V1ConfigMap>(`/api/v1/watch/namespaces/${namespace}/configmaps/${configMapName}`);

watch.subscribe({
    next: event => {
        console.log('Received event: ', event.phase);
        console.log('for configmap: ', JSON.stringify(event.apiObj, undefined, 2));
    }
});

Readme

Keywords

Package Sidebar

Install

npm i k8s-watch-rx

Weekly Downloads

2

Version

0.3.4

License

MIT

Unpacked Size

5.75 kB

Total Files

6

Last publish

Collaborators

  • schaze