5 Tools That Will Boost Your Productivity with Kubernetes

MacOS Edition

Giuseppe Laguteta
4 min readSep 10, 2022

Kubernetes is a powerful container orchestration platform used to automate deployment, management, and scaling of complex applications. It usually comes withkubectl, the client tool that allows users to interact with Kubernetes clusters by using a CLI (Command Line Interface).

Over the years, kubectl has been coupled with tools that the Open Source community developed to improve the user experience. We will list here five of the most powerful and effective tools to work with Kubernetes.

To test the following tools I suggest you to build a Kubernetes playground using kind. It’s an easy way to play with a cluster locally and then clean up when you are done.

# install kind
brew install kind
# create cluster
kind create cluster --name playground --image kindest/node:v1.21.14

1. K9s

A very useful terminal UI, K9s is definitely at the top of my list. Very easy to use, intuitive, it keeps watching the cluster and allows you to easily explore pods by namespace, services, deployments, etc. One click to shell into a pod, inspect the logs, describe, edit or port-forward. I use it in combination with another shell where I run kubect as usual, so that I can get the most from the two interfaces.

brew install k9s

2. Popeye

Colorful tool to sanitize your Kubernenets cluster, Popeye is an Open Source tool that looks for any inconsistencies, generates a report, and rates your cluster.

# Install
brew install derailed/popeye/popeye
# Run
popeye

3. Kube-bench

Kube-bench is another handy tool that checks if your Kubernetes cluster is deployed securely. You can find the project repo here.

# Run kube-bench as a job and inspect the logs
curl https://raw.githubusercontent.com/aquasecurity/kube-bench/main/job.yaml | kubectl apply -f -
# get the logs, replace <kube-bench-95cf7> with your pod id
kubectl logs kube-bench-95cf7 -f

Once you run the job, just select the pod and inspect the log. Again, you can use K9s to quickly observe the cluster when working on it.

4. Kubectx, Kubens and fzf

You are working on many clusters, dev/stg/prod, but also local, cloud… Let’s quickly switch between different contexts and namespaces with kubectx and kubens. In addition, fzf provides an interactive way to switch between the options, no need to write or remember contexts or namespaces.

# Install kubectx, kubens, fzf
brew install kubectx fzf
# Switch between namespaces
kubens

5. Stern

An indispensable log aggregator, Stern will help you collect logs from different pods and distinguish them by color.

# Install
brew install stern
# stern <keyword>
stern deploy

In this example, we have 3 replicas of deploy-demo. We can aggregate the logs by selecting the pods with the keyword deploy. As you can see, each pod corresponds to a different color.

Bonus! Bat

Bat is super useful if you want to quickly inspect your files (especially yaml) directly from the shell. Bat supports themes and other very nice features like the integration with git, definitely to explore!

# Install bat
brew install bat
# Explore themes
bat --list-themes
# Bat a file
bat deployment.yaml

Conclusions

I hope you found this article useful, please add in the comments any other Kubernetes-related tool you are using and that can help others to improve their productivity. Thanks!

--

--