5 Ways To Enhance kubectl UX

Tugboat Labs
1 min readDec 10, 2017

--

Once you start using the Kubernetes CLI (kubectl) often you find that it can get aggravating when you have multiple clusters, multiple namespaces, and typing out long command-line arguments. Below is a list of tools that can ease that pain and make it a delight to work with kubectl.

  1. kubectx — allows you to list and change context in single command https://github.com/ahmetb/kubectx
  2. kubens — allows you yo list and change namespaces in a single command https://github.com/ahmetb/kubectx
  3. kubectl aliases- This works really well so you don’t have to type out really long command line arguments. Be aware though you may start forgetting the actual syntax and may pose challenges when switching to other client machines that don’t have the aliases. https://github.com/ahmetb/kubectl-aliases
  4. iTerm Themes- iTerm themes that allow you to list current context in your prompt. Here’s an example one but many more out there, so just google to find themes it may fit your terminal needs. https://medium.com/@edwardvillalba/playing-the-hell-game-my-zsh-setup-and-why-5757b0cf391e
  5. kubetail — Aggregate logs from multiple pods into a single stream https://github.com/johanhaleby/kubetail

Special thanks to Ahmet Alp Balkan for creating kubectx, kubens, and kubectl aliases, as these tools made my life better.

--

--

Tugboat Labs

Dave Strebel is a Azure Open Source Architect @ Microsoft - My Opinions are my own and don't reflect my employer.