Skip to main content
Kubernetes

KubeTUI: Your Kubernetes Dashboard Right Inside Your Terminal

Efficiently monitor Kubernetes with a dashboard in the terminal.

LHB Community

Warp Terminal

As a Kubernetes engineer, I deal with kubectl almost every day. Pod status, service list, CrashLoopBackOff location, YAML configuration comparison, log view...... are almost daily operations!

But to be honest, in the process of cutting namespaces, manually copying pod names, and scrolling the log again and again, I gradually felt burned out. That is, until I came across KubeTUI — a little tool that made me feel like “getting back on my feet”.

What is KubeTUI

KubeTUI, known as Kubernetes Terminal User Interface, is a Kubernetes visual dashboard that can be used in the terminal. It's not like the traditional kubectl, which lets you memorize and knock out commands, or the Kubernetes Dashboard, which requires a browser, Ingress, and a token to log in to a bunch of configurations.

In a nutshell, it's a tool that lets you happily browse the state of your Kubernetes cluster from your terminal.

Installing KubeTUI

KubeTUI is written in Rust, and you can download its binary releases from Github. Once you do that, you need to set up a Kubernetes environment to build and monitor your application.

Let me show you how that is done, with an example of building a WordPress application.

Setting up the Kubernetes environment

We’ll use K3s to spin up a Kubernetes environment. The steps are mentioned below.

Step 1: Install k3s and run

curl -sfL https://get.k3s.io | sh -

With this single command, k3s will start itself after installation. At later times, you can use the below command to start k3s server. 

sudo k3s server --write-kubeconfig-mode='644'

Here’s a quick explanation of what the command includes :

  • k3s server: It starts the K3s server component, which is the core of the Kubernetes control plane.
  • --write-kubeconfig-mode='644': It ensures that the generated kubeconfig file has permissions that allow the owner to read and write it, and the group and others to only read it. If you start the server without this flag, you need to use sudo for all k3s commands.

Step 2: Check available nodes via kubectl

We need to verify if Kubernetes control plane is actually working before we can make any deployments. You can use the command below to check that:

k3s kubectl get node
kubectl

Step 3: Deploy WordPress using Helm chart (Sample Application)

K3s provides helm integration, which helps manage the Kubernetes application. Simply apply this YAML manifest to spin up WordPress in Kubernetes environment from Bitnami helm chart.

Create a file named wordpress.yaml with the contents:

Content Missing

You can then apply the configuration file to the application using the command:

k3s kubectl apply -f wordpress.yaml

It will take around 2–3 minutes for the whole setup to complete.

Step 4: Launch KubeTUI

To KubeTUI, type in the following command in the terminal.

kubetui
kubetui

Here's what you will see. There are no pods in the default namespace. Let’s switch namespace to wpdev we created earlier by hitting “n”.

change namespaces

How to Use KubeTui

To navigate to different tabs, like switching screens from Pod to Config and Network, you can click with your mouse or press the corresponding number as shown:

kubetui

You can also switch tabs with the keyboard:

kubetui switch tabs

If you need help with Kubetui at any time, press ? to see all the available options.

kubetui help

It integrates a vim-like search mode. To activate search mode, enter /.

Tip for Log filtering 

I discovered an interesting feature to filter logs from multiple Kubernetes resources. For example, say we want to target logs from all pods with names containing WordPress. It will combine logs from both of these pods. We can use the query:

pod:wordpress

You can target different resource types like svc, jobs, deploy, statefulsets, replicasets with the log filtering in place. Instead of combining logs, if you want to remove some pods or container logs, you can achieve it with !pod:pod-to-exclude and !container:container-to-exclude filters.

Conclusion

Working with Kubernetes involves switching between different namespaces, pods, networks, configs, and services. KubeTUI can be a valuable asset in managing and troubleshooting Kubernetes environment. 

I find myself more productive using tools like KubeTUI. Share your thoughts on what tools you’re utilizing these days to make your Kubernetes journey smoother.

CTA Image

Bhuwan Mishra is a Fullstack developer, with Python and Go as his tools of choice. He takes pride in building and securing web applications, APIs, and CI/CD pipelines, as well as tuning servers for optimal performance. He also has a passion for working with Kubernetes.

LHB Community