v0.2.0
REST focused Typescript classes for Kubernetes APIs, and tools for generating API interfaces
Repository
Current version released
4 years ago
Dependencies
deno.land/x
/x/kubernetes_apis
Purpose
Generated, typed interfaces to make every possible Kubernetes API request and work with richer data structures.
Actual request transports implemented in /x/kubernetes_client
.
Usage
Hereās a basic request, listing all Pods in the default
namespace.
It uses the autoDetectClient()
entrypoint which returns the first usable client.
import { autoDetectClient } from 'https://deno.land/x/kubernetes_client/mod.ts';
import { CoreV1Api } from 'https://deno.land/x/kubernetes_apis/builtin/core@v1/mod.ts';
const kubernetes = await autoDetectClient();
const coreApi = new CoreV1Api(kubernetes).namespace("default");
const podList = await coreApi.getPodList();
console.log(podList);
// see files in examples/ for more API demos (watching, creation, etc)
When running locally (with kubectl
set up), you probably just to add --allow-run
to run this.
For a container being deployed onto a cluster, thereās more flags to provide instead;
see /x/kubernetes_client
for more information.
Changelog
v0.2.0
on2020-12-29
:- Includes ābuiltinā APIs generated from K8s
v1.20
. - Patching and deletion is more stable; mistype error messages are vastly improved.
- ApiExtensions and ApiRegistration groups are now included.
- Updating
/x/kubernetes_client
API contract tov0.1.2
. - Reflector implementation has been moved up to
/x/kubernetes_client
. - Coreās proxy endpoints (Node/Pod/Service) are now implemented and usable.
- CRDs are now generated from original YAML instead of from a clusterās generated APIs.
- cert-managerās CRDs have been updated to
v1
and external-dnsās CRDs also added.
- Includes ābuiltinā APIs generated from K8s
v0.1.0
on2020-11-17
:- Initial release, with ābuiltinā APIs generated from K8s
v1.19
. - Thereās still a fair amount of TODOs for particular resources, and structure types.
- A workable Reflector implementation is included.
- cert-managerās CRDs have a generated client as well, as an experiment.
- Initial release, with ābuiltinā APIs generated from K8s
TODO
- PATCH requests
- Solidify Quantity, Duration, etc
- Reconcile deletion response kinds (might still be fallout)
- Story for generating API clients directly from CRD specifications
- Story for generating the whole API surface of a specific cluster
- Move Reflector implementation upstream to
/x/kubernetes_client