Skip to main content
Using Deno in production at your company? Earn free Deno merch.
Give us feedback
Module

x/kubernetes_client/mod.ts>KubectlRawRestClient

Typescript library for accessing a Kubernetes API server
Go to Latest
class KubectlRawRestClient
implements RestClient
Re-export
import { KubectlRawRestClient } from "https://deno.land/x/kubernetes_client@v0.7.0/mod.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; })