All Projects → reconquest → Tubekit

reconquest / Tubekit

Licence: mit
🧪 kubectl alternative with quick context switching, kubectl on steroids

Programming Languages

go
31211 projects - #10 most used programming language

Projects that are alternatives of or similar to Tubekit

Fugitive
Simple command line tool to make git more intuitive, along with useful GitHub addons.
Stars: ✭ 20 (-89.69%)
Mutual labels:  productivity, cli
Ckube
A cli to simplify working with kubectl for some common workflows
Stars: ✭ 127 (-34.54%)
Mutual labels:  cli, kubectl
Baelte
CLI tool for svelte to help you be productive
Stars: ✭ 85 (-56.19%)
Mutual labels:  productivity, cli
Namecheck
Check your name idea availability with CLI
Stars: ✭ 19 (-90.21%)
Mutual labels:  productivity, cli
Backport
A simple CLI tool that automates the process of backporting commits on a GitHub repo
Stars: ✭ 154 (-20.62%)
Mutual labels:  productivity, cli
Sit Up
🙇 Reminder to sit up straight.
Stars: ✭ 9 (-95.36%)
Mutual labels:  productivity, cli
Nnn
n³ The unorthodox terminal file manager
Stars: ✭ 13,138 (+6672.16%)
Mutual labels:  productivity, cli
Things.sh
Simple read-only comand-line interface to your Things 3 database
Stars: ✭ 492 (+153.61%)
Mutual labels:  productivity, cli
Brotab
Control your browser's tabs from the command line
Stars: ✭ 137 (-29.38%)
Mutual labels:  productivity, cli
Kui
A hybrid command-line/UI development experience for cloud-native development
Stars: ✭ 2,052 (+957.73%)
Mutual labels:  cli, kubectl
Ponzu
Headless CMS with automatic JSON API. Featuring auto-HTTPS from Let's Encrypt, HTTP/2 Server Push, and flexible server framework written in Go.
Stars: ✭ 5,373 (+2669.59%)
Mutual labels:  productivity, cli
Licenseplist
A license list generator of all your dependencies for iOS applications
Stars: ✭ 1,996 (+928.87%)
Mutual labels:  productivity, cli
Jrnl
Collect your thoughts and notes without leaving the command line.
Stars: ✭ 5,126 (+2542.27%)
Mutual labels:  productivity, cli
Gita
Manage many git repos with sanity 从容管理多个git库
Stars: ✭ 865 (+345.88%)
Mutual labels:  productivity, cli
Kubelive
kubectl tool reinvented to be more reactive and interactive 🔥
Stars: ✭ 497 (+156.19%)
Mutual labels:  cli, kubectl
Termy
A terminal with autocomplete
Stars: ✭ 112 (-42.27%)
Mutual labels:  productivity, cli
Fubectl
Reduces repetitive interactions with kubectl
Stars: ✭ 370 (+90.72%)
Mutual labels:  cli, kubectl
Protolock
Protocol Buffer companion tool. Track your .proto files and prevent changes to messages and services which impact API compatibility.
Stars: ✭ 394 (+103.09%)
Mutual labels:  productivity, cli
Check It Out
A command line interface for Git Checkout. See branches available for checkout.
Stars: ✭ 127 (-34.54%)
Mutual labels:  productivity, cli
Proji
A powerful cross-platform CLI project templating tool.
Stars: ✭ 156 (-19.59%)
Mutual labels:  productivity, cli

TUBEKIT

All Contributors

tubekit helps you to operate Kubernetes clusters more effectively by reducing time spent on everyday routines.

tubectl

Build Status

Tubectl is a simple yet powerful wrapper around kubectl which adds a bit of magic to your everyday kubectl routines by reducing the complexity of working with contexts, namespaces and intelligent matching resources.

Installation

Arch Linux

The package is always available in AUR: tubekit-git.

Debian/Fedora/CentOS

Packages can be found on releases page.

macOS

brew tap reconquest/tubekit https://github.com/reconquest/tubekit.git
brew install tubekit

Binaries

Binaries can be found on releases page.

Standalone

With your GOPATH already set up:

go get github.com/reconquest/tubekit/cmd/...

Usage

asciicast

Quick context

Very often you need to switch between environments and therefore you need to switch your kubectl's context or specify it in kubectl's command line with the flag --context. Well, there is even no short option for that flag. This is where tubectl starts its magic.

You can just specify @ followed by a name of the context, you don't need to specify full name of the context, it will be matched by the existing list of contexts specified in your kubectl configs.

Instead of typing kubectl --context staging or kubectl --context production now you just type tubectl @st or tubectl @prod. It doesn't mean that --context will no longer work because it will. tubectl does not break kubectl as it has full backwards compatibility with the original kubectl.

Quick namespaces

Boring to type -n monitoring, huh? Here is the solution — don't type so much, just type +mon with tubectl. tubectl retrieves a list of namespaces from a cluster and matches given namespace. It's fully back compatible with -n --namespace flags.

Forget about --all-namespaces, just use the ++ flag.

With kubectl you used to do like that:

kubectl --context staging --all-namespaces get pods

Now you can type:

tubectl @st ++ get pods

Instead of kube-system in such command:

kubectl get pods -n kube-system

You can now type like this:

tubectl get pods +sys

Also, you can type ++ and @st at the end of cmdline or in the middle of it, it really doesn't matter — tubectl will figure it out.

Resource matching

That is the real panacea for several problems if you ever had a thought like:

  • tailing logs of multiple containers at the same time
  • executing a command in multiple containers in serial or parallel mode
  • deleting/retrieving/patching all pods/deployments/ingresses matching given regular expression
  • just want to attach to the first container of the pod with several replicas whatever suffix it might have

Meet the matching operator — %.

For example, we have two replicas of nginx running in a cluster:

nginx-59d4c6bbcf-dft5z                  1/1     Running   8          18d
nginx-59d4c6bbcf-dvfd2                  1/1     Running   8          18d

Instead of getting the list of pods and then running kubectl logs against all of them you can do the following:

tubectl logs nginx%

You need to put % at the end of your matching query, tubectl will figure out what resource are you trying to match, will retrieve list of these resources from given cluster with given namespace, will match it and then run your command against these resources with all other arguments you've passed.

When you specify one % at the end of the query tubectl will run the command against all matched resources. If you want to run only against a specific replica, you need to specify its number like %:X, example:

tubectl logs nginx%:1

In this example, tubectl will retrieve all pods matching nginx and then get 1st pod from the list, the same can be applied to the second pod — %:2.

What if you want to run the command against all the pods but in parallel mode?

Similar to ++ for --all-namespaces tubectl introduces an operator %%, let's say you want to tail logs of all nginx pods at the same time, then you just do the following:

tubectl logs nginx%% -f

tubectl will match resources and will run kubectl logs against all pods at the same time.

Other advanced examples

  • Deleting all deployments matching word backend in staging namespace

    tubectl delete deployment +stag backend%
    

    or in parallel (concurrent) mode:

    tubectl delete deployment +stag backend%%
    
  • Describing all statefulsets matching word redis in staging namespace

    tubectl describe sts +stag redis%%
    

    or in parallel (concurrent) mode:

    tubectl describe sts +stag redis%%
    
  • Executing a command in all pods matching word apiserver or scheduler in kube-system namespace

    tubectl exec +sys '(apiserver|scheduler)%' -- id
    

    or in parallel (concurrent) mode:

    tubectl exec +sys '(apiserver|scheduler)%%' -- id
    

Custom flags

Tubectl supports a few own flags, they all have prefix --tube:

  • --tube-version - prints version of the program
  • --tube-debug - enables debug mode, also can be turned on by TUBEKIT_DEBUG
  • --tube-help - prints short help message about the program.

Support

Have a question or problem? Join us in Slack: slack.reconquest.io

Authors

Hire us, we do reduce business costs by optimizing the things.

License

MIT

Contributors

Thanks goes to these wonderful people (emoji key):

Sergey Romanov
Sergey Romanov

💻
Dmitry Shaposhnik
Dmitry Shaposhnik

📦
Harrison Heck
Harrison Heck

📦

This project follows the all-contributors specification. Contributions of any kind welcome!

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].