nSights Talks


Tutorial Highlights & Transcript

00:00 - Beginning of video
My name is Luis. My topic for today’s K9s. What is the agenda for this demo?
00:15 - Agenda
What is K9s? Some interesting features that we have. The installation. And the demo.
00:26 - What is K9s?
What is K9s? It is a terminal-based UI to interact with your Kubernetes clusters. The aim of this project is to make it easier to navigate, observe and manage your deployed applications. And also, this application is based on go. Basically what this tool is used to use for. Some of us don’t like typing Kube CTL to navigate in our cluster. Some of us may like it or will not have any problem with it. But, there are people like us that prefer to check the navigate through the cluster with the UI.
01:23 - Interesting Features
Some interesting features that the K9s has is that we can track real-time activities, and have resources running in the cluster, right? It can handle standard resources and custom resource definitions. We can track in real-time metrics for the pods, containers, and nodes, that’s very useful. And that’s why we started using it in a project. Because we wanted to track the metrics for the bot. You can drill down directly to what’s wrong with the cluster resources. It has many logging capabilities. And many more things. It can be customizable, right.
02:19 - Installation
The installation is very straightforward. It can be installed on Mac OS, Linux, or Windows. I have installed mine on Windows via Chocolatey. Basically, that’s all. Let me go to the demo.
02:39 - Demo - Walkthrough of K9s
I just need to type K9s and I will see something like this. The first thing that I can do, or is very useful, is the context switch, right? I can see all the clusters that I can log into. Currently, I’m logging into this cluster, it’s a cluster from a customer that we are working on. I cannot see anything because I’m in the default namespace. I can check the pods for example. You can see right here, for example, if I type zero, I can see all the namespaces. If I type one, I can see the monitoring namespace, so I will type one. I can see the pods running for that namespace. For example, if I want to check the Kube system, and pods, I can type two and that’s very useful. I can see what pods we’re running on the Kube system. And the Kube system namespace, for example, I can check the metrics. You can see on the right the CPU, the memory, the percentage of the CPU, and the memory that I’m using. I can see in which node these pods are running. Those kinds of things are very useful for me. It’s very easy to see where if all the pods are running where I want. I can see all the namespaces as I mentioned. I have all the pods that are running basically. I can check all the resources in the cluster. I’m just seeing the ones that we check most frequently.

I can check the nodes. You can see that I have three nodes, the metrics for that node, the CPU and also the memory, and how many pods are running on this node. That can be useful to check the dates and labels. For example, I want to check which pods are running here, I just need to type Enter, and then I can see the pods that are running. Things like that, right? What else can I check? I can check the namespaces. As I mentioned, you can check all the resources that you have in the cluster, right? So yes, that’s another thing that I can check. I can check the services. Here I can see which services are running in which namespace. You can see that in the monitoring namespace, I have Prometheus and Grafana running. In case I want to do something like pod four, I just need to type shift and enter. And you can type which pod you want to use. It’s very simple to use.

So far, this is K9s. For me, it’s very useful. It’s easy for me to manage the resources and check the logs. You can also check the logs for the pods. You just need to see the pods and then you just need to type highlighting, and then you can see the logs basically in real-time logs, right. So that’s kind of helpful. That’s K9s. As I mentioned, it’s very useful if you want to check in real-time metrics and you don’t like to be typing Kube CTL, get logs in the pod, right? You can see all the pods and then just type the logs. You can check the metrics and all these resources.

Jasmeet Singh

Luis Ovalle

DevOps Engineer


Luis joined nClouds in 2020 as a DevOps Engineer. He is an AWS Certified Solution Architect - Associate and Hashicorp Certified - Terraform Associate.