Kubernetes Management with K9s

Kubernetes Management with K9s

ยท

3 min read

As Kubernetes continues to be the de facto standard for container orchestration, SREs / DevOps professionals are constantly on the lookout for tools that can simplify cluster management and enhance productivity. Enter K9s, a terminal-based user interface (TUI) that provides a powerful and efficient way to interact with your Kubernetes clusters.

Why K9s?

Navigating Kubernetes with the kubectl command line can be daunting, especially as the complexity of your environment grows. K9s streamlines this experience by offering a real-time, interactive interface that makes it easier to observe, manage, and troubleshoot your Kubernetes resources.

Getting Started

Installation of K9s is straightforward. You can download the latest binary from the official K9s GitHub repository or install it using package managers like Homebrew for macOS:

brew install k9s

Once installed, simply type k9s in your terminal, and you'll be presented with the main interface showing a list of your pods. (It connects to your cluster/s using the locally available KUBECONFIG

Core Features

Screenshot of the K9s main interface showing deployment status (cannot share screenshot to my official cluster ๐Ÿ˜…)

Independence from Kubectl syntax: Most of the heavy lifting is done by K9s, so little is left to type here.

Cluster Overview: Get a birds-eye view of your cluster, with instant access to pods, deployments, and other resources.

Real-Time Monitoring: Observe real-time updates for your cluster's activity, making it easy to spot issues as they arise.

Logs and Descriptions: View logs for a selected pod or describe resources to inspect their configurations directly within the interface.

Efficient Navigation: Use keyboard shortcuts to quickly navigate between different Kubernetes resources, enhancing your workflow.

Personalizing Your K9s Experience

One of the most powerful aspects of K9s is its ability to be customized. You can create your own set of shortcuts, tweak the display settings, and even create custom resource views. All of this is done through a simple configuration file, .k9s/config.yml, which you can tailor to your liking.

Personal Experience

Exploring K9s, I've found it very helpful for monitoring the health and status of our workloads. Being able to switch contexts and namespaces with a few keystrokes has made multi-cluster management a breeze.

Visit this: https://k9scli.io/ to get lots of answers to your how to's?

K9s tour here

If you're already a user, I'd love to hear about your experience and any tips you might have for me. If you're new to K9s, give it a try and share your first impressions.

P.S: I don't own the images in this blog, I cannot use my official cluster screenshots hence have downloaded it from various sources

Hope the SRE gods are kind and don't page your phone with problems when you're trying to enjoy your weekend.