Table of Contents
- Put your prompt to work
- Cluster context and namespaces switching on your fingertips
- Monitoring cluster health and Kubernetes Resources Right From Your Terminal
- Web UI to remote Kubernetes without installation!
- Checking what the Helm is happening
In this post, I’m going to talk about few tools that I found very useful during my Kubernetes development and presentations. |
Earlier this year, I recorded a three-episode series, «Streaming on Kubernetes: It doesn’t have to be the hard way.»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!
- Github: 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
kubeoff that allow for turning this prompt on and off on demand.
| | It does work great in
Figure 1. Current Kubernetes cluster in your command line
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!
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!
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.
- Github: 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
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.
Also, this tool has many customization hooks!
- Github: https://github.com/vmware-tanzu/octant
Have you ever used 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.
Figure 2. Killer feature is a resource dependency graph
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.
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.
Figure 4. Octant port-forwarding Control Center on localhost
Figure 5. You can get a list of all port forwards
- Name: Helm Cabin
- Github: 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.
Figure 6. Chart details
In my opinion, this is pretty useful tool for housekeeping and audit purposes.
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!