Exploring Kubernetes clusters without having to learn kubectl commands is great both for developers just getting started as well as for administrators looking for a user-friendly way to navigate across resources.
Lens is an integrated development environment (IDE) designed make managing Kubernetes clusters easier. It is built on open-source, is free (with some restrictions), and runs as a standalone application for MacOS, Windows, and Linux.
Lens works with several Kubernetes platforms (e.g. EKS, AKS, GKE, Minikube, Rancher, and OpenShift), by importing on your machine the kubeconfigs of the clusters you want to manage.
Lens is a convenient tool to manage the Kubernetes deployments on a Bright cluster because it allows the management of static configurations, as well as the inspection of events, pods, and log streams in real-time.
Installation
Installing Lens on your machine is straightforward: download the software for your operating system and run the setup if necessary.
Please note you don’t have to install anything in the cluster.
Configuration
Lens automatically reads the Kubernetes configuration files in your home directory. By default, the path is ~/.kube/.
You can copy one or more kubeconfigs from your cluster to your local machine, for example by running:
# scp <username>@<cluster-IP>:~/.kube/config-* ~/.kube/ config-default 100% 7668 1.6MB/s 00:00 config-second 100% 7657 1.7MB/s 00:00
In the preceding example, two Kubernetes instances were deployed with Bright: default and second.
Please note Windows users may have to click on the +
button in the bottom-right corner and add kubeconfigs by selecting their containing directory.
Lens will now automatically detect the two Kubernetes clusters and you will be able to connect to them:
![](https://kb.brightcomputing.com/wp-content/uploads/2021/09/kb-lens-connect-1024x583.png)
If the cluster is not directly accessible by your machine, Lens may fail while connecting to Kubernetes:
![](https://kb.brightcomputing.com/wp-content/uploads/2021/09/kb-lens-tunnel-1024x583.png)
In this case, you can open an SSH tunnel with port forwarding, for example by running:
# ssh -L 10443:localhost:10443 <username>@<cluster-IP>
Usage
Once Lens is configured and the connection to the Kubernetes cluster established, you can explore its default resources (e.g. pods, namespaces, and Helm charts), as well as custom resources (e.g. operators defined by you):
![](https://kb.brightcomputing.com/wp-content/uploads/2021/09/kb-lens-namespaces-1024x583.png)