What Is Kubernetes Lens?
Lens is an integrated development environment (IDE) that allows users to connect and manage multiple Kubernetes clusters on Mac, Windows and Linux platforms. It was originally developed by Kontena, a Finnish startup, and later acquired by Mirantis and open sourced under the MIT license.
Lens provides a graphical interface that:
- Allows users to deploy and manage Kubernetes clusters directly from the console
- Provides built-in dashboards with key metrics and insights into resources running on a cluster, including configuration, networking, storage, and access control
You can download Lens for free from Github.
What Problems Does Lens IDE Solve?
DevOps teams build applications using complex distributed architectures—they iterate locally and push out code to a sequence of Kubernetes clusters for testing, staging, and production using version control and CI/CD tools. Operators use the same tools to build and scale clusters. However, there is a lack of coordination in managing clusters.
Modern enterprises prioritize small, task-specific clusters over large ones. The result is that team members must handle many clusters (sometimes hundreds). The problem is that the CLIs that interact with clusters consume many files, making it harder to manage the complex, diverse range of methods and contexts.
Managing infrastructure from the command line is slow and error-prone, especially when scaling up applications and clusters. Likewise, configurations diverge, becoming more difficult to track. An IDE unifies the tools and information needed to work with different contexts and tasks.
Lens helps deal with these problems by:
- Hiding the complexity of configuring cluster access, allowing you to add clusters automatically.
- Automatically discovering local kubeconfig files and letting you manage clusters across any infrastructure.
- Making it possible to organize large numbers of Kubernetes clusters, to deal with cluster sprawl.
- Managing multiple kubectl versions—Lens installs the required version for each cluster.
- Automatically limiting interactions with RBAC constraints, so users only access permitted resources.
- Automatically installing Prometheus instances in any namespace to provide metrics.
What Is New in Kubernetes Lens 6?
Lens 6 is probably the most significant major release to date. New features include:
- Ability to spin up a local Minikube development environment, with a single node Kubernetes cluster running on a local virtual machine (VM).
- Lens Container Security, providing Common Vulnerabilities and Exposures (CVE) security reports directly within the Lens desktop.
- Built-in chat for technical support (only available with a paid subscription).
In addition, the new version introduces a different subscription model with the following tiers, effective from July, 2022, with a grace period for existing users until January, 2023:
- Lens Personal subscription—for personal use, education, and organizations with less than $10 million in annual revenue or funding.
- Lens Pro subscription—for professional use in large enterprises. Pricing is $19.90 per user per month or $199 per user per year.
There is no change to licensing for the community version, OpenLens, and also no changes to upstream projects used by Lens Desktop.
Getting Started with Lens
Download an installer suitable for your platform from the Lens website. Run the installer and open Lens. When you first open the app, you will be prompted to enter your Lens ID:
- If you already have a Lens ID or need to create one, select Lens ID.
- If you have already set up an activation code, select Activation Code to proceed with air-gapped installation.
To perform an air-gapped installation when you don’t have an activation code, you can:
- Generate a lens ID on an Internet-connected device, via the Lens website.
- Generate an activation code for your air gap mount on the Manage Lens ID page in the Lens Desktop interface.
You are then prompted to choose Lens Personal or Lens Pro (a paid subscription with a 30-day trial). After you finish installation, the application automatically checks for and installs updates.
Connecting to a Cluster
Lens searches common directories on your machine for kubeconfig files. On the welcome page, click Browse clusters in catalog to see clusters that were automatically discovered, such as local development clusters. You can click them and Lens will automatically connect to them.
To add a new cluster to the catalog, hover over the blue plus icon in the lower right corner of the screen. You can either copy paste from an existing kubeconfig file, or select an existing file to sync it with Lens.
Adding Helm Repositories
The Helm package manager for Kubernetes is built into Lens and the popular bitnami chart repository is enabled by default. To add a new repository, from the operating system’s taskbar menu, click Lens and select Settings. In the Settings window, select Kubernetes and scroll down to the Helm Charts section.
Here you can add one of the listed repositories or select your own custom Helm repository.
Enabling Lens Metrics
Lens can run a small instance of Prometheus in the cluster and view metrics on the nodes, depending on the RBAC permissions in the account. If you’re already running Prometheus, you can export metrics from that instance to Lens.
To configure metrics, right-click the Cluster icon in the left-hand navigation and select Settings > Metrics. Select a metric to connect to an existing metric system (such as an existing Prometheus instance).
After you select the metric, if you choose the option of creating a new Prometheus instance, it will take a minute or two to start. Lens connects to Prometheus, and cluster metrics automatically appear in the cluster dashboard.
Basic Lens Usage
Lens lets you view all objects and abstractions in your Kubernetes cluster. To see the types of resources available, from the left hand navigation, select Workloads. The Overview screen appears, which shows a summary of the types and number of resources running in your cluster.
You can edit, save and reapply YAML in the built-in editor, by drilling down anywhere and right-clicking on the submenu associated with an item. Developers with private clusters can quickly iterate and see results in real-time. Shared clusters fully integrate role-based access control (RBAC) to ensure that only users with the appropriate credentials can access and edit objects in the cluster.
Lens also allows you to click any container to run a terminal window inside the container, or fetch container and pod logs. If you’re using infrastructure as code (IaC), Lens lets you open any number of terminals and quickly browse your local repositories to find the files you need. For example, you can push changes to Git, run Docker commands, or open files in your IDE or editor for modification and version control.
3 Kubernetes Lens Alternatives
Kubernetes Lens is a great tool but has its disadvantages. Here are three popular solutions DevOps teams are considering as alternatives to Lens.
Product info: https://komodor.com/
Komodor is an end-to-end Kubernetes operations solution for Dev and Ops teams that is designed to bring back control over your Kubernetes environment.
Komodor provides automated playbooks for every K8s resource, and static-prevention monitors that enrich live & historical data with contextual insights to help enforce best practices and stop incidents in their tracks. By baking K8s expertise directly into the product, Komodor is accelerating response times, reducing MTTR and empowering dev teams to resolve issues efficiently and independently.
- Single dashboard to access multiple clusters, and namespaces with easy access to resources related information
- Cross clusters events screen to correlate multiple changes and how they affect each other
- Comparison between resources on multiple clusters/namespace
- Pro-active monitors detecting cluster availability and health issues
- Additional context on errors with details and suggestions to help developers solve issues by themselves
License: Apache License 2.0
Rancher is a popular Kubernetes multi-cluster management solution. The Rancher Dashboard is a stateless client for the Rancher API, built with Vue.js and NuxtJS. It is built and packaged as a folder of static HTML/CSS/JS files that are bundled with all Rancher releases. When you use rancher, the Rancher Dashboard index.html file is displayed as a fallback for any request that doesn’t match a specific API URL.
Rancher Dashboard shows all Kubernetes types, namespaces, and actions that the authenticated user has access to. The default views are raw YAML from the Kubernetes API, with a detail page and table view for list pages (kubectl get commands). You can customize columns to create your own view of configurations and resource listings.
License: Apache License 2.0
Skooner provides a Kuberntes dashboard including configuration and workload views, and the ability to edit YAML directly in the UI. Additional features include:
- Full cluster management—namespaces, nodes, pods, replica sets, deployments, storage, RBAC, etc.
- Live data—shows latest cluster status without refreshing the page.
- Visualizes cluster health—real-time graphs enable tracking of underperforming resources.
- CRUD and scaling with inline API documentation to understand what each field does.
- Responsive design—works on desktop, smartphone, and tablet.
- OpenID integration—no special agents required
- Quick installation—provides YAML resources that make it possible to install Skooner in under a minute.