Manage and Monitor Kubernetes with ease - Lens IDE

I came across a wonderful solution for managing and monitoring the Kubernetes cluster and wanted to share my experience in this post with screenshots.

While there are a lot of ways to monitor the Kubernetes cluster like setting up Prometheus, Grafana Deamon set and sidecar container strategies etc.

All of them take considerable time and effort and a lot of copy and paste of YAML files. Even if you are going with helm charts it requires some additional skills and a learning curve too.

The solution am going to cover in this article is a unique solution and can be installed/set up with a click of a button.

Besides that, this is not just a monitoring solution. this is an Integrated Development Environment, Every Kubernetes Developer and Administrator must have on their computer

Say Bye to Kubectl commands and welcome Lens IDE

 

Lens - IDE for Kubernetes

Yes. It's an IDE like Visual Studio Code, IntelliJ dedicated to Kubernetes.

But How can it monitor the Kubernetes clusters, nodes, pods anyway

Lens IDE uses kube-metrics and prometheus to collect the monitoring data and metrics.

If you have not already installed these in your Kubernetes cluster. you can install them right from the Lens IDE with a Single Click

I know what you feel, this is just another tool to take up your system space. Don't come to any conclusion yet.

These  Lens IDE pictures(screenshots) can convince you better than words could do. take a look at what it has to offer

 

Monitoring Kubernetes with Lens IDE

In this segment, we are going to see what monitoring options are views provided by Lens IDE in detail with screenshots.

Kubernetes Cluster monitoring

Control plane monitoring.

Kubernetes Monitoring

Node monitoring

This is done using node-exporter internally and helps us to monitor CPU, Memory and Disk usage of the Nodes

Kubernetes IDE

Workload monitoring

Here is the workload monitoring showing the resource-wise statistics for

  • Pods
  • Deployments
  • StatefulSets
  • Jobs
  • ReplicaSets
  • Daemon Sets etc

Kubernetes IDE

Pods monitoring

This view here shows the list of pods on All namespaces ( can be filtered)  with the number of containers and their health and the Node they are deployed to.

Another great feature I like is I can see who controls this pod or what created this pod.

When you select a POD you get more information like CPU, Memory, Network, FileSystem etc

In fact, I can dig further (scroll down) and get more details on this pod such as Container level information

  • Image of the container
  • Environment variables available for the container
  • Volume Mounts
  • Startup Arguments

Kubernetes Monitoring

Deployments Monitoring

This shows the Deployment wise monitoring view and the usage statistics along with the PODS underneath.

Besides the aforementioned monitoring views. Lens IDE also provides the following monitoring views

  • DeamonSets
  • StatefulSets
  • ReplicateSets
  • Jobs
  • CronJobs

you can click on the corresponding tab to select the view and explore the resources underneath

Updating the YAML Configuration with Lens IDE

You can also edit and update the YAML (configuration) of any resource like Pod, Deployment, ConfigMaps right from the Lens IDE itself

For example, If you want to update the CPU Limit of the deployment while it is LIVE. you can just select the deployment and click the edit button

change the CPU limit value and click on the Save & Close button

you will see the message Applying and Deployment updated message

you can go to the POD view to make sure the PODs are recreated with the updated values for additional confirmation

Scale the Deployment  ( Increase/Decrease Replica )

To Scale Up or Scale Down the Deployment. there is a dedicated button on the top right

Refer to the following screenshot where the Mouse is highlighting

Scale Kubernetes Deployment

When you click that said button.  you will see a popup modal with the interactive controller to increase the number of replicas

Create/Update/View/Delete the Secrets

With Lens IDE, you can create, update, view and Delete  the secrets

To create a new secret Navigate to Configuration > Secrets on the Lens IDE

After selecting the right namespace, you can click on the + sign on the right bottom you will see a modal to enter the data.

Kubernetes Lens

To View the secret you can select the secret and on the Data field click on the eye icon to view

Kuberentes Decrypt Secret

If you are new to Kubernetes and thinking Secrets are confidential and must not be seen.  Let me tell you Secrets are basically base 64 encoded texts

If you want to save the secret as secret, consider using some Secret manager

the secrets can be decrypted using kubectl command as well. like follows

➜  ~  kubectl get secret api-token-apm -o go-template='{{range $k,$v := .data}}{{"### "}}{{$k}}{{"\n"}}{{$v|base64decode}}{{"\n\n"}}{{end}}'
### token
Some_Secret_token

 

Now, If you are already convinced you might be looking for installation instructions. that's the next chapter

Downloading and Installing Lens IDE

You can go straight to https://k8slens.dev/

Lens IDE

Hope this article helps.

If you have any toolset or best practices you would like to share with our community, please do comment

 

Cheers
Sarav AK

Follow me on Linkedin My Profile
Follow DevopsJunction onFacebook orTwitter
For more practical videos and tutorials. Subscribe to our channel

Buy Me a Coffee at ko-fi.com

Signup for Exclusive "Subscriber-only" Content

Loading