Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/kubernetes_apis/deps.ts>KubectlRawRestClient

REST focused Typescript classes for Kubernetes APIs, and tools for generating API interfaces
Latest
class KubectlRawRestClient
implements RestClient
Re-export
import { KubectlRawRestClient } from "https://deno.land/x/kubernetes_apis@v0.5.3/deps.ts";

A RestClient for easily running on a developer's local machine. Your existing kubectl is called to do all the actual authentication and network stuff. This is pretty reliable but mot all types of requests can be performed this way.

Deno flags to use this client: --allow-run=kubectl

Pro: Any valid kubeconfig will be supported automatically :) Con: In particular, these features aren't available:

  • Setting or receiving HTTP headers
  • HTTP methods such as PATCH and HEAD
  • Fully-detailed error payloads
  • Differentiating successful & quiet stream vs stalled stream setup

Constructors

new
KubectlRawRestClient(contextName?: string)

Properties

namespace

Methods

private
emulateExecTunnel(
namespace: string,
podName: string,
querystring: URLSearchParams,
signal?: AbortSignal,
): Promise<KubernetesTunnel>
performRequest(opts: RequestOptions): Promise<any>
runKubectl(args: string[], opts: { abortSignal?: AbortSignal; bodyRaw?: Uint8Array; bodyJson?: JSONValue; bodyStream?: ReadableStream<Uint8Array>; bodyPassthru?: boolean; })