Back to blog

Kubernetes

Kubernetes CLI Tools to Boost Your Productivity

Boost your Kubernetes productivity with essential CLI tools and tips for streamlined cluster management.

January 1, 2020 Platform Engineering 5 min read

Mastering kubectl is valuable, but day-to-day work on real clusters usually benefits from a few extra tools as well. The right CLI utilities can make context switching, troubleshooting, log analysis, and YAML inspection much faster.

Below is a practical list of Kubernetes CLI tools that are worth having close at hand.

Helm

Helm is the package manager for Kubernetes. It packages Kubernetes resources into charts so applications can be deployed and managed with a cleaner abstraction.

Using Helm can help you:

  • encapsulate deployment complexity inside a chart
  • reuse common application packages
  • version deployments cleanly
  • roll back releases more easily

kubectx and kubens

kubectx and kubens make it much easier to switch between clusters and namespaces.

  • kubectx lists available contexts and switches between them
  • kubens lets you change the default namespace quickly

If you work across multiple clusters, these tools save a surprising amount of time.

K9s

K9s is a terminal UI for navigating and operating Kubernetes clusters. It makes it easier to inspect workloads, view logs, examine YAML, and perform common actions without leaving the terminal.

It is especially useful when you want something faster than browsing raw kubectl output but lighter than a full desktop UI.

Stern

Stern tails logs from multiple pods and containers in real time. That makes it particularly useful for microservices and multi-replica workloads where a single pod log is not enough to understand what is happening.

krew

krew is the package manager for kubectl plugins. Once installed, it makes it much easier to discover and maintain community plugins.

kubectl krew install <plugin-name>

Useful plugins include:

  • tree
  • neat
  • ctx
  • ns

kubetail

kubetail aggregates logs from multiple pods into one output stream. It is useful when you want a simple way to follow a deployment or service without reaching for a heavier log stack.

kubectl-aliases

kubectl-aliases gives you a full set of shell aliases for common kubectl commands, such as:

  • k for kubectl
  • kgp for kubectl get pods
  • kdsvc for kubectl describe svc
  • krm for kubectl delete

If you spend all day in the terminal, the keystroke savings add up quickly.

kube-ps1

kube-ps1 adds the current Kubernetes context and namespace to your shell prompt. That small change can prevent a lot of mistakes when working across multiple clusters or environments.

kubectl-tree

kubectl-tree helps visualise ownership relationships between Kubernetes resources.

kubectl tree deployment/my-app

It is particularly handy when you are trying to understand how a Deployment, ReplicaSet, Pods, and other objects relate to each other.

kubectl-neat

kubectl-neat removes clutter such as managedFields and status from Kubernetes YAML and JSON output.

kubectl get pod my-pod -o yaml | kubectl neat

That makes manifests much easier to read when reviewing or debugging resources.

Auto-Completion

Shell completion for kubectl is still worth setting up:

source <(kubectl completion bash>)

It is a small quality-of-life improvement that speeds up common commands and reduces typing mistakes.

Conclusion

kubectl remains the core tool, but a few well-chosen extras can make Kubernetes administration much smoother. Tools like Helm, kubectx, kubens, K9s, Stern, and krew help remove friction from the command line and let you spend more time solving real cluster problems.