@pongsatt/k8sclient
v1.0.0
Published
Kubernetes client in Typescript (Support 1.7 to 1.11)
Readme
k8sclient
Kubernetes client in Typescript (Support 1.7 to 1.11)
Description
This client is generated from Kubernetes Swagger Spec.
Installing
npm install @pongsatt/k8sclientor
yarn add @pongsatt/k8sclientCluster configuration
It will automatically detect if run inside or outside a cluster. In case of running outside a cluster, user configuration under ~/.kube will be used.
Usage example
Talking to kubernetes 1.10 - Core api.
import {client110} from '@pongsatt/k8sclient';
const core = new client110.CoreV1Api();
...run inside an async function
// Reading a service in default namespace
const result = await core.readCoreV1NamespacedService('a service name', 'default');
// Listing pods with a name from default namespace
const podList = await core.listCoreV1NamespacedPod('default', undefined, undefined, undefined, false, `name=${name}`);