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

x/kubernetes_client/tunnel-beta/via-websocket.ts>WebsocketRestClient

Typescript library for accessing a Kubernetes API server
Go to Latest
class WebsocketRestClient
import { WebsocketRestClient } from "https://deno.land/x/kubernetes_client@v0.7.0/tunnel-beta/via-websocket.ts";

Extension of KubeConfigRestClient, adding tunnel support via WebSocketStream. WebSockets have various limits within the Kubernetes and Deno ecosystem, but they work quite well in several situations and have good backpressure support.

  • For most clusters, you'll need to have Deno trust the cluster CA. Otherwise you'll get an UnknownIssuer error. In-cluster, you just need to pass --cert /var/run/secrets/kubernetes.io/serviceaccount/ca.crt

  • Restricted for out-of-cluster use due to lack of Client Certificates. https://github.com/denoland/deno/issues/11846 Workaround of using kubectl proxy --reject-paths=/^-$/

  • Restricted for port-forwarding due to lack of dynamic multiplexing. Every new port connection requires a new WebSocket. (TODO: find or create Kubernetes ticket to track this)

  • stdin restricted for exec/attach due to lack of EOF signal. Upstream work: https://github.com/kubernetes/kubernetes/pull/119157

Methods

performRequest<Tproto extends string>(opts: RequestOptions & { expectTunnel?: Tproto[]; })