Monitoring Your Kubernetes Cluster at a Glance with Lens

David SmithbauerCloud and Virtualization, Industry Trends, Technical TipsLeave a Comment

Kubernetes is an incredible technology that enables you to do so much more with your resources than ever before. But, how do you know what’s going on inside your cluster? Many folks are already aware of in-cluster solutions like Prometheus and Grafana. These de-facto tools do an excellent job of storing and displaying cluster metrics and performance over time. What if you have more than one cluster to monitor, though? You’d need to log in and view your Grafana dashboards in each cluster or create a combined dashboard showing all your clusters’ current state.

Lens is a rapidly growing, free, and open source “Kubernetes IDE” project. In fact, Lens just recently (Jan. 12, 2021) hit a new milestone as a Top 20 open source project for Kubernetes (ranked by GitHub Medium star gazers).

Lens lets you monitor and operate a single or multiple Kubernetes clusters easily and quickly with its open source desktop application. Simply download the binary for your favorite OS (Windows, Mac, Linux all supported) and install. Lens releases new updates each month, so you’ll be getting the latest features delivered right to your desktop after that. Add your clusters and watch some “getting started” videos, and you’re on your way.

Under the hood, Lens uses the Prometheus stack to obtain all the cluster-specific metrics. So, you’ll still need to have Prometheus installed and configured, but Lens can help you with that too! Simply right-click on your cluster in the sidebar, click Settings, and notice the Features → Metrics Stack option. If you don’t already have a Prometheus stack installed, you can simply click the Install button, and away you go.

If you already have one installed, you can make some minor tweaks to ensure Lens fully displays your cluster data accurately. See their Troubleshooting documentation for more information. Also, don’t forget to install the Kubernetes Metrics Server project as Lens uses this to display some node and pod-level data. If these tasks seem a little daunting, check back here soon for another blog post outlining how to install and configure the Prometheus Operator and Metrics Server in your cluster(s)!

Lens combines some of my favorite features of custom Grafana dashboards with the functionality I use every day from the MS VS Code Kubernetes extension. It’s easy to view logs, terminal into a running pod, cordon and drain a node, or simply view the state of your cluster quickly!

Lens also supports extensions too. There aren’t many available at this time, as this is a brand new feature, but I’m sure there will be more coming soon.

Let me know what you think of Lens or what your favorite Kubernetes monitoring stack looks like. I’d love to hear from you! Feel free to contact me directly or leave a comment below. And, if you need help on your cloud native journey, M&S has the people, skills, and partnerships to make your transition a successful one!

David Smithbauer | M&S Cloud Native Architect, DevOps Engineer

Leave a Reply

Your email address will not be published.