Kubernetes Lens: How To Enhance Your Kubernetes Cluster
Tags: cloud, kubernetes, devops
Published: 2023-07-19 06:42:16

<!-- wp:paragraph -->
<p>You probably know this feeling really well: one day you’re managing clusters like a pro, and another day you face a tornado of errors and bugs attacking you everywhere. We all love Kubernetes, but saying that it makes things a bit complicated would be an understatement. There’s a reason why solutions that make DevOps lives easier – with <strong>Kubernetes Lens</strong> among them – are popping up all over the place.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>Kubernetes gives us a lot of good stuff – portability, extensibility, openness to automation, and an easier time managing containerized applications. But it has <strong>a lot of moving parts and tricky areas around scaling clusters, orchestrating storage, <a href="https://cast.ai/blog/batch-processing-4-tactics-to-make-it-cost-efficient-and-reliable/">batch processing</a></strong>, and many others. Using command-line CLIs</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>Another problem with Kubernetes is the use of <strong>command-line interfaces</strong> (CLIs), which may overwhelm anyone used to the clarity of modern GUIs.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>No wonder the market is full of tools that solve such Kubernetes-specific issues. One of them is Kubernetes Lens, a solution that has gained a lot of traction recently. What problems does it help DevOps solve, and how do you make it work? Keep reading and learn more about Kubernetes Lens.</p>
<!-- /wp:paragraph -->

<!-- wp:heading {"anchor":"h-what-is-kubernetes-lens"} -->
<h2 class="wp-block-heading" id="h-what-is-kubernetes-lens">What is Kubernetes Lens?</h2>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p>Kubernetes Lens is an open-source integrated development environment (IDE) for Kubernetes. It simplifies K8s management by letting cloud-native developers manage and monitor clusters in real time.&nbsp;</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>In 2020, <strong>Mirantis</strong> purchased Lens from <strong>Kontena</strong> and later open-sourced it and made it freely available (<a href="https://github.com/lensapp/lens" target="_blank" rel="noreferrer noopener">here’s the repo</a>). A number of Kubernetes and cloud-native ecosystem pioneers, including Apple, Rakuten, Zendesk, Adobe, and Google, support it.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>A stand-alone tool that works on macOS, Windows, and various Linux distributions, Lens lets developers connect to and manage multiple Kubernetes clusters.&nbsp;</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>It comes with a clear, user-friendly <strong>graphical interface</strong> that helps you deploy and manage clusters directly from the console. Lens also provides <strong>dashboards</strong> that deliver <strong>helpful metrics</strong> and insights into everything that happens on a cluster, such as installations, configurations, networking, storage, and access control.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>The latest and most significant release of Lens is Lens 6. It has the following new features:</p>
<!-- /wp:paragraph -->

<!-- wp:list -->
<ul><!-- wp:list-item -->
<li>You can launch a local Minikube development environment, complete with a single-node Kubernetes cluster operating on a local virtual machine (VM).&nbsp;</li>
<!-- /wp:list-item -->

<!-- wp:list-item -->
<li>Container Security, which provides security reports on Common Vulnerabilities and Exposures (CVE) right from the Lens desktop.</li>
<!-- /wp:list-item -->

<!-- wp:list-item -->
<li>Built-in technical help chat (available only with a premium membership).</li>
<!-- /wp:list-item --></ul>
<!-- /wp:list -->

<!-- wp:paragraph -->
<p>The new version introduces a different subscription model with the following tiers:</p>
<!-- /wp:paragraph -->

<!-- wp:list -->
<ul><!-- wp:list-item -->
<li><strong>Lens Personal subscription </strong>– this package is meant for personal use, education, and organizations with annual income or financing of less than $10 million.</li>
<!-- /wp:list-item -->

<!-- wp:list-item -->
<li><strong>Lens Pro subscription </strong>– for professional usage in large companies, $19.90 per month or $199 per year per user.</li>
<!-- /wp:list-item -->

<!-- wp:list-item -->
<li>The licensing for the community version, <strong>OpenLens</strong>, remains unchanged, as do the upstream projects utilized by Lens Desktop.</li>
<!-- /wp:list-item --></ul>
<!-- /wp:list -->

<!-- wp:heading {"anchor":"h-what-problems-does-kubernetes-lens-solve"} -->
<h2 class="wp-block-heading" id="h-what-problems-does-kubernetes-lens-solve">What problems does Kubernetes Lens solve?</h2>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p>Cloud-native DevOps teams develop applications by iterating locally and using version control and CI/CD to push code to a sequence of Kubernetes clusters for testing, staging, and production. Clusters are built and scaled using the same tools by operators. The coordination of cluster management often becomes an issue.&nbsp;</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>Small, task-specific clusters are <strong>prioritized above big clusters</strong> in many companies. As a result, teams end up managing a large number of clusters. The issue here is that the CLIs that interface with clusters consume lots of files, making it difficult to handle the complex and diverse set of methods and contexts.&nbsp;</p>
<!-- /wp:paragraph -->

<!-- wp:quote {"className":"is-style-plain"} -->
<blockquote class="wp-block-quote is-style-plain"><!-- wp:paragraph -->
<p>When scaling up apps and clusters, managing infrastructure via the command line is sluggish and error-prone. Configurations may also differ, making tracking more challenging. An IDE combines the tools and information required to deal with various settings and jobs.&nbsp;</p>
<!-- /wp:paragraph --></blockquote>
<!-- /wp:quote -->

<!-- wp:paragraph -->
<p>Kubernetes Lens helps in dealing with these issues by:</p>
<!-- /wp:paragraph -->

<!-- wp:list -->
<ul><!-- wp:list-item -->
<li>Reducing the complexity of setting cluster access and enabling you to automatically add clusters.&nbsp;</li>
<!-- /wp:list-item -->

<!-- wp:list-item -->
<li>Discovering local kubeconfig files automatically and allowing you to manage clusters across practically any infrastructure.&nbsp;</li>
<!-- /wp:list-item -->

<!-- wp:list-item -->
<li>To cope with cluster sprawl, it is now feasible to arrange a large number of Kubernetes clusters.</li>
<!-- /wp:list-item -->

<!-- wp:list-item -->
<li>Managing various kubectl versions – Lens installs the version necessary by each cluster.&nbsp;</li>
<!-- /wp:list-item -->

<!-- wp:list-item -->
<li>Interactions with RBAC requirements are automatically restricted so that users only access resources that are authorized.&nbsp;</li>
<!-- /wp:list-item -->

<!-- wp:list-item -->
<li>Installing Prometheus instances automatically in any namespace to deliver metrics.</li>
<!-- /wp:list-item --></ul>
<!-- /wp:list -->

<!-- wp:heading {"anchor":"h-key-features-of-kubernetes-lens"} -->
<h2 class="wp-block-heading" id="h-key-features-of-kubernetes-lens">Key features of Kubernetes Lens</h2>
<!-- /wp:heading -->

<!-- wp:heading {"level":3,"anchor":"h-cluster-management"} -->
<h3 class="wp-block-heading" id="h-cluster-management">Cluster management</h3>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p>Adding a Kubernetes cluster to Lens is really simple: direct the local/online kubeconfig file to Lens, and it will detect and connect to it. Lens allows you to view all of the resources operating within your cluster, from simple pods and deployments to bespoke types provided by your apps.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>With Kubernetes Lens, you can work on many clusters while preserving context with each of them. <strong>It organizes and reveals the complete working system in the cluster while delivering analytics</strong>, allowing you to setup, change, and reroute clusters with a single click. With this knowledge, you can make changes fast and confidently.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>Lens Connector is one cool feature of Lens. It’s a built-in terminal employs a kubectl version that is API-compatible with your cluster. The terminal can identify your cluster version automatically and then assign or download the appropriate version in the background. As you transition from one cluster to another, you keep the right kubectl version and context.</p>
<!-- /wp:paragraph -->

<!-- wp:heading {"level":3,"anchor":"h-user-friendly-gui"} -->
<h3 class="wp-block-heading" id="h-user-friendly-gui">User-friendly GUI&nbsp;</h3>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p>Since managing many clusters across diverse platforms requires interpreting multiple access contexts, modes, and techniques for structuring the infrastructure, Lens provides a solution to administer Kubernetes via GUI.&nbsp;</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p><strong>Solving all of these via the command line would otherwise be complex, time-consuming, and prone to error.</strong> This is due, in part, to the ever-increasing number of clusters and applications, as well as their configurations and requirements.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>Using Kubernetes Lens GUI, you can:</p>
<!-- /wp:paragraph -->

<!-- wp:list -->
<ul><!-- wp:list-item -->
<li>manually add clusters by browsing through their kubeconfigs,</li>
<!-- /wp:list-item -->

<!-- wp:list-item -->
<li>quickly find kubeconfig files on your own system,</li>
<!-- /wp:list-item -->

<!-- wp:list-item -->
<li>organize clusters into workgroups based on how you interact with them,</li>
<!-- /wp:list-item -->

<!-- wp:list-item -->
<li>visualize the state of objects in your cluster, such as pods, deployments, namespaces, network, storage, and even custom resources – making it simple to detect and debug any cluster issues.</li>
<!-- /wp:list-item --></ul>
<!-- /wp:list -->

<!-- wp:paragraph -->
<p>And if you still enjoy using the CLI, you can use Lens’s built-in terminal to run your preferred kubectl command line.</p>
<!-- /wp:paragraph -->

<!-- wp:heading {"level":3,"anchor":"h-metrics-and-visualization"} -->
<h3 class="wp-block-heading" id="h-metrics-and-visualization">Metrics and visualization&nbsp;</h3>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p>Kubernetes Lens has a Prometheus configuration with multi-user functionality that provides role-based access control (RBAC) for each user. This implies that users may only view visualizations for which they have authorization.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>When you configure a Prometheus instance in Lens, it offers <strong>cluster metrics and visualizations</strong>. Lens autodetects Prometheus for that cluster after installation and starts providing cluster metrics and visualizations. You may also use Prometheus to preview Kubernetes manifests before applying them.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>Real-time graphs, resource utilization charts, and use data such as CPU, RAM, network, and requests are available with Prometheus and become part of the Lens dashboard. You’ll see these metrics displayed in the context of the specific cluster in real time.</p>
<!-- /wp:paragraph -->

<!-- wp:heading {"level":3,"anchor":"h-handy-integrations"} -->
<h3 class="wp-block-heading" id="h-handy-integrations">Handy integrations&nbsp;</h3>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p>Lens smoothly integrates with a wide range of Kubernetes tools. One good example is Helm, which helps you make <a href="https://cast.ai/blog/cluster-autoscaler-helm-chart-how-to-improve-your-eks-cluster/">Helm charts</a> and releases simple to deploy and manage in Kubernetes.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>You can access available Helm repositories from the Artifact Hub, which, by default, adds a Bitnami repository if no other repositories are specified. Other repositories can be added manually via the command line if necessary.&nbsp;</p>
<!-- /wp:paragraph -->

<!-- wp:heading {"level":3,"anchor":"h-lens-extensions"} -->
<h3 class="wp-block-heading" id="h-lens-extensions">Lens Extensions</h3>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p>Kubernetes Lens Extensions enable you to add new and custom features and visualizations to expedite the development processes for all <strong>Kubernetes-integrated technologies and services</strong>.&nbsp;</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>Kubernetes Lens also allows you to use the Lens APIs to script your own extensions. They let you add additional object information, create custom pages, add status bar items, and make other UI changes. The Kubernetes Lens install screen can use a tarball link that extensions have uploaded to npm to produce.</p>
<!-- /wp:paragraph -->

<!-- wp:heading {"level":3,"anchor":"h-collaboration-and-teamwork-via-kubernetes-lens-spaces"} -->
<h3 class="wp-block-heading" id="h-collaboration-and-teamwork-via-kubernetes-lens-spaces">Collaboration and teamwork via Kubernetes Lens Spaces</h3>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p>Kubernetes Lens encourages teamwork and collaboration with its Spaces feature. It's basically a location for cloud-native development teams and projects to collaborate.&nbsp;</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>You can easily organize and access your team clusters from anywhere with a Lens space: EKS, GKE, AKS, on-premises, or a local dev cluster. Users will be able to quickly access and securely share all clusters in one space.</p>
<!-- /wp:paragraph -->

<!-- wp:heading {"anchor":"h-kubernetes-lens-alternatives-to-make-your-k8s-ride-even-smoother"} -->
<h2 class="wp-block-heading" id="h-kubernetes-lens-alternatives-to-make-your-k8s-ride-even-smoother">Kubernetes Lens alternatives to make your K8s ride even smoother</h2>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p>Kubernetes Lens is a powerful tool for everyone looking to get things done quickly and move on to more impactful activities. You can find even more solutions in the K8s ecosystem that streamline your work even more.&nbsp;</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>CAST AI is an autonomous Kubernetes management platform that automates a lot of the heavy lifting around cloud infra management to make engineers more efficient. Once you onboard CAST AI, you’ll end up using Lens even less – and put <a href="https://cast.ai/blog/cloud-automation-the-new-normal-in-the-tech-industry/">cloud automation</a> in place to do a lot of things for you.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p><strong>Check out the <a href="https://docs.cast.ai/docs/getting-started">docs</a> to learn more about CAST AI’s capabilities around autoscaling, instance rightsizing, automated instance provisioning and decommissioning, and more.</strong></p>
<!-- /wp:paragraph -->