Code Monkey home page Code Monkey logo

kex's Introduction

The purpose of kex is to provide an opinionated executor into a kubernetes container. Traditionally, if one wanted to exec into a kubernetes container, one had to kubectl get pods --namespace foo, visually identify the pod of interest, copy that pod to the buffer, and then kubectl --namespace foo exec -it <paste_buffer> bash to exec into the pod. This simple utility aims to provide a namespace-specific pod selector for quick execution.

kex

asciicast

kex(1)

NAME
    kex - Quick k8s pod exec utility.

REQUIRES
    kubectl(1)

SYNOPSIS
    kex [OPTIONS]

DESCRIPTION
    kex is a quick kubernetes (k8s) utility to exec into a pod. kex prompts for:
    - <NAMESPACE> (defaults to current ns. See kubens(1))
    - <POD> (defaults to "1")
    - <COMMAND> (defaults to bash)
  ENTER to use defaults.

OPTIONS
    -h, --help
        Show this help message

SEE ALSO
    kubectx(1), kubens(1)

USAGE

$ kex
Namespace? (default qux):
    1 qux
    2 quux
    3 quuz
    4 corge
    5 grault
    6 garply
    7 waldo
    8 fred
    9 plugh
    10 xyzzy
    11 thud
4
Pod number? (default 1):
    1 foo-drupal
    2 bar-mariadb
    3 baz-alpine
2
Command? (default bash)
mysql

Welcome to the MariaDB monitor.  Commands end with ; or \g.
MariaDB [NAME]>

Installation

For macOS:

Use the Homebrew package manager:

brew tap farmotive/k8s
brew install kex

NOTE: If using gcloud sdk to manage the installation and versioning of kubectl, install with the --without-kubernetes-cli flag to omit the brew dependency:

brew install kex --without-kubernetes-cli

See farmotive homebrew k8s install section for more options.

Other platforms:

  • Download the kex script
  • Add it somewhere in your PATH
  • Make it executable (chmod +x)

Disclaimer: This is not an official Google product.

Thanks to ahmetb for the inspiration!

kex's People

Contributors

bookshelfdave avatar lypht avatar scottrigby avatar

Watchers

 avatar  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.