A story about FE dev and his best K9s buddy handling Kubernetes

Jiří Náhlovský
Dr.Max Product Blog
3 min readJun 13, 2022

Not long ago as a frontend developer at that time. In a rapidly changing company heading to the Azure clouds, I was somehow oscillating around Kubernetes [* for now on just Kube or K8s for shortness] for a while. Back then I just kind of knew how Docker virtualization works and had some basic general knowledge about K8s. How to list running pods with kube-ctl (CLI tool for managing Kube), to see logs, and connect to the running app. That's pretty much it. Most of the time, I rather avoided tasks requiring work with Kube. But then...

A buddy of mine from our dev team (credit to PŠššššš… 🤫) showed me this cool, colorful, and MS-DOS-like app running in the terminal and it was my WOW-CLICK-CLACK-WRUUM-WRUUUM-AHAAAAA insta-moment when he said to it: “Just imagine K8s like SQL database holding current state in tables for each resource. You can directly edit them, delete some or just look deeper for details and once you do some changes Kube just knows and make shit happen to reflect them.
Friends, since I started with Kube and the progress I did so far was not, let's say satisfying, this was exactly what I needed.
Everything started to be more clear and accessible even more with the tool bringing good old NortonCommander vibes. All stuff regarding clusters, contexts, namespaces, pods, and services started making more sense altogether, and managing things around K8s began to be fun.
That is the tool I've been missing, something visual, other than verbose CLI commands which were hard to grasp and sometimes complicated to get even right.

Official video — how using the K9s actually looks https://asciinema.org/a/305944

What I recommend and appreciate nowadays in K9s the most

You can find most features and their shortcuts in a small guide on top of the screen.

  • Simple yet powerful and clean GUI
  • Inspecting pods with describe command
  • Checking resources used
  • The last time the pod was deployed
  • Accessing logs even for failing pods
  • Exec (shell) into the pod
  • Easy port-forwarding pods to the local machine

Hints for must-use shortcuts

  • First “:” for switching between resources (contexts, pods, deployments, config-maps, ingresses, etc…
  • Second “/” for filtering resources by name

The best part is that everything mentioned above is just about one or two keystrokes. Simple and quick. And that's only icing on the cake from what this tool can offer. More can be found on the official website here https://k9scli.io/.

Quick installation using Brew on MacOS

But don't forget to set up the connection to the Kubernetes cluster before running K9s.

> brew install derailed/k9s/k9s
> k9s

Enjoy the greatness.

--

--