5 Kubernetes Tools You Probably Don’t Use (But You Should)
Tags: kubernetes, tools, devops
Published: 2020-03-30 05:06:08

---
title: 5 Kubernetes Tools You Probably Don’t Use (But You Should)
published: true
description: Viktor Gamov, developer advocate at Confluent, shares his favorite tools for Kubernetes
tags: Kubernetes, tools, devops
canonical_url: https://gamov.io/posts/2020/03/26/2020-03-11-5-kubernetes-tools-you-probably-dont-use-but-you-should.html
---

Table of Contents

- [Put your prompt to work](#put-your-prompt-to-work)
- [Cluster context and namespaces switching on your fingertips](#cluster-context-and-namespaces-switching-on-your-fingertips)
- [Monitoring cluster health and Kubernetes Resources Right From Your Terminal](#monitoring-cluster-health-and-kubernetes-resources-right-from-your-terminal)
- [Web UI to remote Kubernetes without installation!](#web-ui-to-remote-kubernetes-without-installation)
- [Checking what the _Helm_ is happening](#checking-what-the-helm-is-happening)
- [Conclusion](#conclusion)

 ![k9s ksql](http://gamov.io/images/k9s_ksql.jpg)

TL;DR
In this post, I’m going to talk about few tools that I found very useful during my Kubernetes development and presentations. |

{% youtube HgyoBrFsJdg %}

Earlier this year, I recorded a three-episode series, [«Streaming on Kubernetes:](https://youtu.be/JiDiC5MI7hw) [It doesn’t have](https://youtu.be/9HaKP6HBz3s) [to be the hard way.»](https://youtu.be/lzFuEuqOSNM)There I showed some demos of the Confluent Operator on Kubernetes. Many people reached out after and asked - «What kind of terminal do you use,» «What kind of plugins do you use» and so far and so on. And today, I’m going to be talking about five Kubernetes tools that I use in my demos (of during preparations to it) that you’re probably don’t use but defiantly should.

So, let’s get to it - it’s going to be fun!

## Put your prompt to work

- **Name:** `kube-ps1`
- **Github:** [https://github.com/jonmosco/kube-ps1](https://github.com/jonmosco/kube-ps1)

OK, I do demos.Many demos.OK, not like a lot of demos but still, a large number of demos.And things that I’m usually demoing very technical.So technical some things I demo don’t even have GUI.The only thing that I have to interact with those things is the command line interface, aka terminal.

As the theatre starts with a coat, a proper terminal starts with a prompt.Because during those technical demos, there are many things going in on the screen.

So, having an excellent terminal prompt that will allow the audience and yours truly always to know where we are?That’s why I appreciate `kube-ps1` that displays information about the current Kubernetes cluster context as part of a terminal prompt.Also, it adds two a helper commands `kubeon` and `kubeoff` that allow for turning this prompt on and off on demand.

| | It does work great in `bash` and `zsh`. |

 ![kubeon](http://gamov.io/images/kubeon.jpg)

Figure 1. Current Kubernetes cluster in your command line

## Cluster context and namespaces switching on your fingertips

- **Name:** `kubectx` and `kubens`

- **Github:** [https://github.com/ahmetb/kubectx](https://github.com/ahmetb/kubectx)

Next, I do create and use many Kubernetes clusters on a daily basis.Some days I may create a few Kubernetes clustersSaying this, I need to switch between those quite often.It may need to type a few commands if you don’t know what full name of a cluster (and I can be a quire long)See yourself!

kubectx

```
kubectl config get-contexts (1)
kubectl config current-context (2)
kubectl config use-context <NAME OF CONTEXT> (3)
```

| **1** | Get list of all Kubernetes clusters configured in your system |
| **2** | Get a current cluster context |
| **3** | Set desired cluster context |

Not so useful, right?Yet, there is a better way!

Enter `kubectx.`

 ![kubectx demo](https://github.com/ahmetb/kubectx/raw/master/img/kubectx-demo.gif)

`kubectx` allows switching between Kubernetes clusters few quickly.It also integrates with command pager utility, and allows you to have some text menu where you can choose a specific cluster!

As a bonus, there is another tool that comes from the same author called `kubens` that I allow to switch namespaces withing the same cluster context.Same with namespace switching - not rocket science, but you need to remember or google those commands all the time.

## Monitoring cluster health and Kubernetes Resources Right From Your Terminal

- **Name:** `k9s`
- **Github:** [https://github.com/derailed/k9s](https://github.com/derailed/k9s)

OK, good, now you learned to switch between Kubernetes clusters and namespaces in those clusters.The next tool can be a bit useful because it provides a GUI (terminal UI) tool that allows you to interact with your Kubernetes cluster.

You can see:

- Standard Kubernetes resources and well as custom resources and `KafkaCluster` or `PhysicalStatefulCluster`

- You can drill down to pods and see logs from the individual containers.

- You watch health and vitals of your Kubernetes cluster and your applications.

 ![k9s ksql](http://gamov.io/images/k9s_ksql.jpg)

Also, this tool has many customization hooks!

## Web UI to remote Kubernetes without installation!

- **Name:** `octant`
- **Github:** [https://github.com/vmware-tanzu/octant](https://github.com/vmware-tanzu/octant)

Have you ever used [Kubernetes Dashboard](https://github.com/kubernetes/dashboard)?Yes, you have because it’s a standard monitoring dashboard for Kubernetes.But there is one slight problem - it requires installation on your cluster.If you don’t have enough rights, or your operations folks don’t want to have extra crap installed in your Kubernetes cluster, this may be a challenge to get you GUI.

Enter Octant. It’s a web-based Kubernetes resource visualizer.

And it doesn’t require installation on your Kubernetes cluster.Octant runs locally on your machine and talks to Kubernetes via standard API calls.

 ![octant](http://gamov.io/images/octant.jpg)

Figure 2. Killer feature is a resource dependency graph

 ![octant crds](http://gamov.io/images/octant_crds.png)

Figure 3. Apart from understanding standard Kubernetes resource, `octant` shows some custom resources

Another very cool feature of octant is «Port Forwarding».It works like this:

- Navigate to the resource, e.g. `controlcenter` `StatefulSet`

- Scroll to the container that want to forward ports from.

- And you can click «Start Port Forward».

- Octant UI will display localhost and port to the pod.

 ![octant c3](http://gamov.io/images/octant_c3.png)

Figure 4. Octant port-forwarding Control Center on localhost

 ![octant port](http://gamov.io/images/octant_port.png)

Figure 5. You can get a list of all port forwards

## Checking what the _Helm_ is happening

- **Name:** Helm Cabin
- **Github:** [https://github.com/Nick-Triller/helm-cabin](https://github.com/Nick-Triller/helm-cabin)

Our last small nifty tool for today is Helm Cabin - your dashboard for helm releases.image::helm-cabin.jpg[]

You will be able to see all your helm releases deployed to given Kubernetes cluster.Once you click on one of the release names, we drill down to some helm release info - NOTES from chart, templates and values, and «effective» chart.

 ![cabin chart details](http://gamov.io/images/cabin_chart_details.png)

Figure 6. Chart details

In my opinion, this is pretty useful tool for housekeeping and audit purposes.

## Conclusion

If you have found this video useful or entertaining, hit that like button and consider subscribing to this channel.Stay tuned for the next one.And as always, have a nice day!