A replacement for "kubectl exec" that works over WebSocket connections.

kubectl-execws

A replacement for "kubectl exec" that works over WebSocket connections.

Kubernetes API server has support for exec over WebSockets, but it has yet to land in kubectl. This plugin is designed to be a stopgap until then!

Usage:

execws <pod name> [--kubeconfig] [-n namespace] [-it] [-c container] <cmd>

Features

  • Aware of HTTP_PROXY/HTTPS_PROXY env variables
  • Uses standard Kubeconfig processing including ~/.kube/config & $KUBECONFIG support
  • Doesn't use SPDY so might be more loadbalancer/reverse proxy friendly

Acknowledgements

Work inspired by rmohr/kubernetes-custom-exec and kairen/websocket-exec.

Similar Resources

OCI transport plugin for apt-get (i.e., apt-get over ghcr.io)

apt-transport-oci: OCI transport plugin for apt-get (i.e., apt-get over ghcr.io) apt-transport-oci is an apt-get plugin to support distributing *.deb

Nov 1, 2022

Access your Kubernetes Deployment over the Internet

Access your Kubernetes Deployment over the Internet

Kubexpose: Access your Kubernetes Deployment over the Internet Kubexpose makes it easy to access a Kubernetes Deployment over a public URL. It's a Kub

Dec 5, 2022

PolarDB Stack is a DBaaS implementation for PolarDB-for-Postgres, as an operator creates and manages PolarDB/PostgreSQL clusters running in Kubernetes. It provides re-construct, failover swtich-over, scale up/out, high-available capabilities for each clusters.

PolarDB Stack is a DBaaS implementation for PolarDB-for-Postgres, as an operator creates and manages PolarDB/PostgreSQL clusters running in Kubernetes. It provides re-construct, failover swtich-over, scale up/out, high-available capabilities for each clusters.

PolarDB Stack开源版生命周期 1 系统概述 PolarDB是阿里云自研的云原生关系型数据库,采用了基于Shared-Storage的存储计算分离架构。数据库由传统的Share-Nothing,转变成了Shared-Storage架构。由原来的N份计算+N份存储,转变成了N份计算+1份存储

Nov 8, 2022

Connect, Subscribe and Publish over MQTT broker to check its status.

MQTT Blackbox Exporter Introduction In each probe it sends a message over MQTT broker and then wait for getting it over subscription. By measuring thi

Aug 27, 2022

Package trn introduces a Range type with useful methods to perform complex operations over time ranges

Time Ranges Package trn introduces a Range type with useful methods to perform c

Aug 18, 2022

Kubectl-over-env - Created for github actions or any other CI/CD-Pipelining tool which cannot push to a custom local kubernetes cluster

kubectl-over-env This repository was created for github actions or any other CI/

Jan 4, 2022

Nutrition-overengineering - Application to calc healthcare and nutrition metrics, but using the most over engineered as possible

nutrition-overengineering Application to calc healthcare and nutrition metrics,

Nov 2, 2022

My over-engineered homepage project to get an idea of the Kubernetes

My over-engineered homepage project to get an idea of the Kubernetes. It shows traffic data from all my GitHub repositories. I added RabbitMQ, Redis and MongoDB so I got to play around with multiple k8s resources

Jan 15, 2022

Sapfun - Utility that takes control over your video card coolers to keep it cool and steady

What? sapfun - Utility that takes control over your video card coolers to keep i

Feb 18, 2022
Comments
  • panic: assignment to entry in nil map

    panic: assignment to entry in nil map

    Hello, i am having below issue

    panic: assignment to entry in nil map

    goroutine 1 [running]: net/textproto.MIMEHeader.Set(...) /usr/local/Cellar/go/1.17.5/libexec/src/net/textproto/header.go:22 net/http.Header.Set(...) /usr/local/Cellar/go/1.17.5/libexec/src/net/http/header.go:38 k8s.io/client-go/plugin/pkg/client/auth/exec.(*roundTripper).RoundTrip(0xc00052a1c8, 0xc000275400) /Users/twanc/go/pkg/mod/k8s.io/[email protected]/plugin/pkg/client/auth/exec/exec.go:310 +0x18d github.com/jpts/kubectl-execws/cmd.doExec(0xc0000f7d60) /Users/twanc/Tests/kubectl-execws/cmd/exec.go:155 +0x12c github.com/jpts/kubectl-execws/cmd.glob..func1(0x1aa1400, {0xc00008af80, 0x2, 0x4}) /Users/twanc/Tests/kubectl-execws/cmd/root.go:59 +0x2be github.com/spf13/cobra.(*Command).execute(0x1aa1400, {0xc0000200b0, 0x4, 0x4}) /Users/twanc/go/pkg/mod/github.com/spf13/[email protected]/command.go:860 +0x5f8 github.com/spf13/cobra.(*Command).ExecuteC(0x1aa1400) /Users/twanc/go/pkg/mod/github.com/spf13/[email protected]/command.go:974 +0x3bc github.com/spf13/cobra.(*Command).Execute(...) /Users/twanc/go/pkg/mod/github.com/spf13/[email protected]/command.go:902 github.com/jpts/kubectl-execws/cmd.Execute() /Users/twanc/Tests/kubectl-execws/cmd/root.go:69 +0x25 main.main() /Users/twanc/Tests/kubectl-execws/main.go:6 +0x17

    Any ideas whats wrong? Thanks

  • Fix a nil header reference on GKE connect attempts

    Fix a nil header reference on GKE connect attempts

    I used this to test out a websocket tunnel and ran into an exception on GKE:

    $ ./kubectl-execws -it busybox -- ls -lh /
    panic: assignment to entry in nil map
    
    goroutine 1 [running]:
    net/textproto.MIMEHeader.Set(...)
        /usr/lib/google-golang/src/net/textproto/header.go:22
    net/http.Header.Set(...)
        /usr/lib/google-golang/src/net/http/header.go:40
    k8s.io/client-go/plugin/pkg/client/auth/exec.(*roundTripper).RoundTrip(0xc0002dc7b0, 0xc000276000)
    

    Initializing the header struct fixes it.

Sesame: an Ingress controller for Kubernetes that works by deploying the Envoy proxy as a reverse proxy and load balancer

Sesame Overview Sesame is an Ingress controller for Kubernetes that works by dep

Dec 28, 2021
kubetnl tunnels TCP connections from within a Kubernetes cluster to a cluster-external endpoint, e.g. to your local machine. (the perfect complement to kubectl port-forward)

kubetnl kubetnl (kube tunnel) is a command line utility to tunnel TCP connections from within a Kubernetes to a cluster-external endpoint, e.g. to you

Dec 16, 2022
Audit your egress connections and finally populate this OUTPUT chain !

egress-auditor Audit your egress connections and finally populate this OUTPUT chain ! Summary egress-auditor will monitor new outbound connections and

Aug 9, 2022
HTTP load generator, ApacheBench (ab) replacement, formerly known as rakyll/boom
HTTP load generator, ApacheBench (ab) replacement, formerly known as rakyll/boom

hey is a tiny program that sends some load to a web application. hey was originally called boom and was influenced from Tarek Ziade's tool at tarekzia

Jan 3, 2023
Golang based tool that acts as a readelf replacement for Orbis ELFs (oelfs)

Tool Documentation (readoelf) Summary The readoelf tool is meant to be a replacement for the standard readelf found on most systems. The reason a repl

Aug 14, 2022
twtr (pronounced "tweeter") is a drop-in replacement of the original twtxt client

twtr twtr (pronounced "tweeter") is a drop-in replacement of the original twtxt client, with some extensions and bonus features, so you can make the s

Jun 24, 2022
Compose Switch is a replacement to the Compose V1 docker-compose (python) executable

Compose Switch Compose Switch is a replacement to the Compose V1 docker-compose (python) executable. It translates the command line into Compose V2 do

Jan 8, 2023
easy way to distribute commands over ssh.

grapes grapes is lightweight tool designed to distribute commands over ssh with ease. Update (25/04/2019) Handshake validation is now in place in orde

Dec 20, 2022
HTTP load testing tool and library. It's over 9000!
HTTP load testing tool and library. It's over 9000!

Vegeta Vegeta is a versatile HTTP load testing tool built out of a need to drill HTTP services with a constant request rate. It can be used both as a

Dec 30, 2022
Run VS Code on any server over SSH.
Run VS Code on any server over SSH.

sshcode This project has been deprecated in favour of the code-server install script See the discussion in #185 sshcode is a CLI to automatically inst

Dec 25, 2022