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.
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.
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:
If the cluster is not directly accessible by your machine, Lens may fail while connecting to Kubernetes:
In this case, you can open an SSH tunnel with port forwarding, for example by running:
# ssh -L 10443:localhost:10443 <username>@<cluster-IP>
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):