Coder Social home page Coder Social logo

kubectl-execws's Introduction

kubectl-execws

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

The Kubernetes API server has support for exec over WebSockets, but it has yet to land in kubectl. Although some proposals exist to add the functionality, they seem quite far away from landing. This plugin is designed to be a stopgap until they do.

Usage:

Usage:
  kubectl-execws <pod name> [options] -- <cmd>

Flags:
  -c, --container string             Container name
  -h, --help                         help for execws
      --kubeconfig string            kubeconfig file (default is $HOME/.kube/config)
  -v, --loglevel int                 Set loglevel (default 2)
  -n, --namespace string             Set namespace
      --no-sanity-check              Don't make preflight request to ensure pod exists
      --node-direct-exec             Partially bypass the API server, by using the kubelet API
      --node-direct-exec-ip string   Node IP to use with direct-exec feature
  -k, --skip-tls-verify              Don't perform TLS certificate verifiation
  -i, --stdin                        Pass stdin to container
  -t, --tty                          Stdin is a TTY

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
  • Supports a full TTY (terminal raw mode)
  • Can bypass the API server with direct connection to the nodes kubelet API

Tab Completion

Tab completion is available for various shells [bash|zsh|fish|powershell].

This can be used with the standalone binary through use of the completion subcommand, eg. source <(kubectl-execws completion zsh)

Completion is also available when using as a kubectl plugin. To set this up it is necessary to symlink to the multi-call binary with a special name: ln -s kubectl-execws kubectl_complete-execws.

Acknowledgements

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

kubectl-execws's People

Contributors

jpts avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.