kubernetes-client-sdk
v1.1.0
Published
Lightweight Kubernetes API SDK for pods, deployments, config maps, and scaling operations.
Downloads
125
Maintainers
Readme
kubernetes-client-sdk
kubernetes-client-sdk is a lightweight wrapper around the Kubernetes HTTP API for common automation tasks.
Installation
npm install kubernetes-client-sdkFeatures
- list pods, deployments, and config maps
- scale deployments
- update config maps
- inject a custom
fetchimplementation for tests or server runtimes
Usage
const KubernetesClientSdk = require('kubernetes-client-sdk');
const client = new KubernetesClientSdk({
baseUrl: 'https://cluster.example.com',
token: process.env.K8S_TOKEN,
namespace: 'production',
});
const pods = await client.getPods();
await client.scaleDeployment('api', 4);API
new KubernetesClientSdk(options)getPods(namespace?)getDeployments(namespace?)getConfigMaps(namespace?)scaleDeployment(name, replicas, namespace?)applyConfigMap(name, data, namespace?)getResource(path)request(method, path, body?, extraHeaders?)
License
MIT
