5 Things You Didn't Know You Could Do with Lens
Over 750,000 users—and many thousands of organizations—rely on Lens to interact with Kubernetes clusters. Every day, these developers and operators alike use Lens to reduce complexity and accelerate productivity with Kubernetes.
But even if you’re an experienced Lens user, there’s a good chance that you haven’t taken advantage of every feature that Lens has to offer. In this post, we’ll take a look at five things you might not have known you could do with Lens—and explain how they can make your life easier.
1. Run a local development cluster
Need a development cluster on your machine? If you’re writing apps and services to run on Kubernetes, there’s a good chance that you do: it’s essential to see how your code works on the cluster.
Many teams and independent developers rely on dev clusters that run on development machines rather than the cloud. If that sounds like you, there’s no need to wrangle additional tools—Lens has you covered. With a Lens Pro subscription, you can launch a lightweight dev cluster with a click of a button.
To launch Lens Desktop Kubernetes, click Lens Desktop Kube in the lower right corner. You’ll have the option to choose your Kubernetes version and node specs.
Developers who use Lens know that it’s indispensable for taming the inner loop of Kubernetes development, which runs from writing code to building container images to deploying on the cluster and checking logs—and back around again. A CI/CD solution is one piece of the puzzle, but whatever tools you use, Lens clears the way so you can focus on code.
As you build Kubernetes-native services and applications, it’s essential to have a dev environment that is aligned with production—and to get kubectl out of your way. Now Lens Desktop Kubernetes lets you run your dev cluster from the same pane of glass.
You can check out this feature with a free 30-day trial of Lens Pro.
2. Port forwarding for local development
Whatever distro or tool they’re using for local dev clusters, Kubernetes developers need a way to smoothly and simply test their apps and services.
But by its very nature, Kubernetes can make quick test-runs and debugging unwieldy—the sort of annoyance that aggregates into big chunks of lost productivity over time. This is one step in the inner loop challenge mentioned above. You may need to test a Pod or Service exposed on port 80—but it’s exposed on a virtual machine, or within a container, or on a remote node, when you really need to check out the workload in the browser on your local machine.
Lens provides one-click, no-fuss port forwarding, so you can focus on your code. If you’re working on a web client, you can simply click on the Pod or Service, scroll down, and click the Forward button. Lens will start a port forward and open the browser.
3. Drill down into—and download—logs
Troubleshooting Kubernetes workloads and resources via the command line can get thorny quickly—and it’s another area where lots of momentary slowdowns can add up quickly.
Lens takes the pain out of delving into logs. Need to search for errors in the logs of a particular Pod? You don’t have to fight with kubectl over and over to investigate an issue. Just select the Pod and click on the Pod Logs icon.
From here, you can review the Pod logs in a tabbed display. Navigate between the logs of multiple containers in a given Pod, and optionally view the logs with timestamps. If a container crashed within the Pod, you can also view the logs of that previous container. No need to remember kubectl arguments—the options you need are available with just a couple of clicks.
If you need to share or commit your logs, you can download them to your local machine in a .log file. When you do so, you can also choose to download all logs for the Pod in a single file using the dropdown menu.
4. Securely onboard teammates with a simple link—and standardize their tools
Lens Pro simplifies onboarding and collaboration for teams working on Kubernetes.
With your Lens ID and a Team Space, you can easily and securely share cluster access and manage RBAC, removing friction while maintaining security with end-to-end encryption. Simply send developers a link to provide secure access to the cluster—no need to expose kubeconfigs. Better yet, you can manage permissions in a granular way, so developers only have access to the necessary namespaces and resources.
Once your teammates are onboard, they’ll have access to the same shared catalog of resources, so they’re synchronized and ready to go right from the start. And with Lens as a shared platform, it’s easy to standardize your team’s tools.
Take monitoring, for example. Lens comes bundled with a stack of essential Kubernetes monitoring tools, including Prometheus, kube-state-metrics, and node-exporter.
You can enable these from the Lens Metrics tab on the cluster settings pane (accessible by right-clicking the cluster icon in the left-hand toolbar).
For many users, multi-cluster management is a highlight of Lens. But if your work has been focused on a single cluster, you may not have realized that Lens can help you work across multiple clusters simultaneously.
When you combine this with Lens’ bundled monitoring, this can give your entire team a unified monitoring stack for all your clusters, all consolidated within a single management console. And the standardization doesn’t end with monitoring. Lens Pro subscribers have access to built-in container-scanning, so you can check for vulnerabilities and unify around the same tools, all easily accessible from one place.
5. Build on Lens with extensions
Did you know you can monitor Kubernetes costs directly from Lens, or scan and detect misconfigurations and vulnerabilities? How about testing your cluster’s resilience with an arcade classic?
Like Kubernetes, Lens is a platform designed for extensibility, so you can tailor your tools to your precise needs. You can reach the Lens Extensions pane through the system menu:
From here, you can install the extensions of your choice:
There are a variety of third-party extensions available, from both vendors and community contributors, including:
Kubecost by Kubecost: Monitor cost data by namespace.
Kubescape by Armo: Scan for misconfigurations, vulnerabilities, and RBAC violations.
Starboard by Aqua Security: Gain visibility into vulnerability assessment reports for workloads.
Space Invaders by chenhunghan: Gamify chaos engineering by shooting down Pods—literally!—within Lens. Not for production, obviously!
You can find a complete list of extensions on GitHub.
If you’re interested in developing your own Lens Extensions, check out the Lens Extension API docs.
Next steps
Still haven’t tried Lens? Download it here. Interested in getting started with Lens Pro? Grab a Lens Pro Trial here and get started today. Do you have a favorite “hidden gem” feature that we didn’t mention here? Let us know in the comments!