Pimp Your Terminal for Kubernetes

In this blog i will list some of the tools that could pimp your Mac terminal for Kubernetes

iTerm2
https://www.iterm2.com/features.html
It simply better terminal with better tabs and windows management than Mac default terminal.

Oh My ZSH
https://ohmyz.sh/
it replaces bash! it makes plugin installations and aliases easier.

Kube-PS1
https://github.com/jonmosco/kube-ps1
kube-ps1 will show the cluster and namespace you are in on the terminal prompt.

prompt

kubectx and kubens
https://github.com/ahmetb/kubectx
If you are tired from kubectl config use-context, kubectx and kubens makes it easy to switch between cluster and namespaces.

kubectx demo GIF
kubens demo GIF

Create Aliases
You can simple enter below as zsh aliases

alias k='kubectl'
alias kg='kubectl get'
alias kgpo='kubectl get pod'

I don’t recommend more than those. in my case i tend to forget my own aliases and role back to the normal commands 🙂

K9s
More and more i am becoming dependent on K9s. it is CLI UI for K8s! it give the capability to visualize and switch between K8s objects on your terminal.



Microsoft Visual Studio Code
if you like Microsoft Visual Studio Code, you could use zsh instead of bash as your terminal. and you will get all above goodies in VSC. you can even install Kubernetes plugin and visualize your clusters and namespaces and witch between them by simply clicking at them. VSC will provide the capability to edit Yaml files and see your terminal on single window

I personally prefer iTerm2 as it is lighter and easier to arrange with other windows such as browsers.

Octant
https://github.com/vmware-tanzu/octant
Even though Octant is not a terminal tool. i will list it here because you can simply launch it from your terminal.
It is a live GUI for K8s that run locally on client machine by simply entering “octant”. it will pull the info from the config files and access your K8s clusters. It is way better than Kubernetes native dashboard.

Octant demo

Now you can run demos as a Pro!

Thank you for reading!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: