Installation lens-best Kubernetes dashboard and IDE

To
You can download this article in PDF format via the link below to support us.

Download the guide in PDF format

turn off
To

To
To

When talking about containers, I believe you know the kind of enthusiasm, commotion, focus and attention that you have received over the past five years or so. The organization has actually been shaken, reorganized, and other organizations are thinking about the opportunities, risks and challenges that this paradigm of handling infrastructure and business applications will bring. Currently, developers, DevOps engineers, operations teams and blue teams are doing their best to evaluate the feasibility of this dizzying new trend of containerized applications.

The core of the discussion and paradigm shift here are well-known names such as Kubernetes, Docker, Podman, OpenShift, containerted, CRI-O, Rancher, etc. You have a considerable number of people, and we believe you have burned the oil at midnight to understand their full meaning.

Today, we have introduced another name and player in Lens, a vast field called “Kubernetes IDE”. So what lens is this?

For simplicity, Lens is a standalone application for MacOS, Windows and Linux operating systems. It can help people have a deeper, better, and more beautiful appearance and insight into their Kubernetes clusters. It is the most powerful IDE for people who need to deal with Kubernetes clusters every day. It can help ensure that its cluster is set up and configured correctly, increase its visibility, get real-time statistics, log streaming and hands-on troubleshooting capabilities. With Lens, you can use clusters more easily and faster, thereby fundamentally improving productivity and business speed. Best of all, it is open source and free. Guess what, you can contribute to this noble project and be a part of its beauty.

Lens function

In addition to the Lens we have discussed, it also has the following other features:

  • Multi-cluster management: Access and use clusters with confidence from a unified IDE. Lens can be used with any number of Kubernetes clusters.
  • Built-in Prometheus statistics: View all relevant graphs and resource utilization charts integrated as part of the dashboard. Lens comes with a built-in multi-tenant Prometheus setting that will respect each user’s RBAC.
  • Context-aware terminal: The built-in terminal comes with kubectl, which is always compatible with your cluster API in the correct context. Lens built-in terminal will ensure that the version of the Kubernetes cluster API is compatible with the version of kubectl.
  • Multiple workspaces: Organize clusters into logical groups. The workspace is used to organize multiple clusters into logical groups.

In order to test and view the functionality of Lens, we will install k3 on a Linux virtual machine, and then connect Lens to it to view indicators and monitor its health. K3s is a certified high-availability Kubernetes distribution designed for unattended, resource-constrained remote locations or production workloads inside IoT devices. First, let’s install k3s on Linux.

Install k3 on Linux (optional-if you don’t have a Kubernetes cluster)

Run the following command to download and install k3:

$ curl -sfL https://get.k3s.io | sudo sh -

[INFO]  Finding release for channel stable
[INFO]  Using v1.18.8+k3s1 as release
[INFO]  Downloading hash https://github.com/rancher/k3s/releases/download/v1.18.8+k3s1/sha256sum-amd64.txt
[INFO]  Downloading binary https://github.com/rancher/k3s/releases/download/v1.18.8+k3s1/k3s
[INFO]  Verifying binary download
[INFO]  Installing k3s to /usr/local/bin/k3s
[INFO]  Creating /usr/local/bin/kubectl symlink to k3s
[INFO]  Creating /usr/local/bin/crictl symlink to k3s
[INFO]  Creating /usr/local/bin/ctr symlink to k3s
[INFO]  Creating killall script /usr/local/bin/k3s-killall.sh
[INFO]  Creating uninstall script /usr/local/bin/k3s-uninstall.sh
[INFO]  env: Creating environment file /etc/systemd/system/k3s.service.env
[INFO]  systemd: Creating service file /etc/systemd/system/k3s.service
[INFO]  systemd: Enabling k3s unit
Created symlink /etc/systemd/system/multi-user.target.wants/k3s.service → /etc/systemd/system/k3s.service.
[INFO]  systemd: Starting k3s

Check whether the node is normal

$ sudo k3s kubectl get node

NAME        STATUS   ROLES    AGE   VERSION
localhost   Ready    master   20m   v1.18.8+k3s1

In view of this, this means that we will continue with Lens now. Let’s install the lens.

For more information about K3, please visit: K3s homepage You can follow the detailed deployment guide for lightweight Kubernetes clusters using K3s in 5 minutes to extend it to other nodes.

Other Kubernetes installation guides:

Use Rancher RKE to install a production Kubernetes cluster

Use kubeadm to install a Kubernetes cluster on Ubuntu

Use EKS to easily set up a Kubernetes cluster on AWS

Install Lens Kubernetes dashboard and IDE

To install the lens, you can Download the pre-built package from the release page Or you can install it via snapcraft (Linux only). I am on Manjaro and will use the snapcraft method. If you are using Windows, please visit the link abpve and download the Windows version. Since this version is pre-built, installation is very simple.

Enable capture

--- Arch Linux / Manjaro ---
sudo pacman -S snapd

--- Ubuntu / Debian ---
sudo apt update
sudo apt install snapd

--- CentOS ---
sudo yum install epel-release
sudo yum install snapd

After the installation is complete, the systemd unit used to manage the main fast communication socket needs to be enabled as follows:

sudo systemctl enable --now snapd.socket

To enable classic snapshot support, enter the following to create a symbolic link between /var/lib/snapd/snap and /snap:

sudo ln -s /var/lib/snapd/snap /snap

Restart the computer to ensure that all paths are updated accordingly.

After backing up your PC, simply run the following command to install Lens:

sudo snap install kontena-lens --classic

If you are on a Mac, the following command is sufficient to install Lens.

brew cask install lens

Now you can start Lens like any other graphics application, and you should see the interface shown below:

Use Lens for Kubernetes cluster access

By default, the lens looks for ~/.kube/config This file contains information about how to connect to the Kubernetes cluster. In the server where we installed K3, the kubeconfig file is stored in /etc/rancher/k3s/k3s.yaml Used to configure access to the Kubernetes cluster.

To access the cluster from the Lens installed on your personal computer (Linux, Windows or macOS), please copy /etc/rancher/k3s/k3s.yaml On a computer located outside the cluster ~/.kube/config. So i brought it /etc/rancher/k3s/k3s.yaml Create from server .kube Directory and copy the file into it, and rename it to config.

On the server

sudo cp /etc/rancher/k3s/k3s.yaml /home/tech
sudo chown tech:tech /home/tech/k3s.yaml

On your local computer

$ cd ~
$ mkdir .kube
$ cd ~/.kube
$ sftp [email protected]
sftp> get k3s.yaml

Press Ctrl+d to exit

$ mv k3s.yaml config

Then, I replaced “localhost” with the IP or name of the K3s server. The contents of the file are as follows:

apiVersion: v1
clusters:
- cluster:
    certificate-authority-data: LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUJWekNCL3FBREFnRUNBZ0VBTUFvR0NDcUdTTTQ5QkFNQ01DTXhJVEFmQmdOVkJBTU1HR3N6Y3kxelpYSjIKWlhJdFkyRkFNVFU1T0RZek56Y3dOakFlRncweU1EQTRNamd4T0RBeE5EWmFGdzB6TURBNE1qWXhPREF4TkRaYQpNQ014SVRBZkJnTlZCQU1NR0dzemN5MXpaWEoyWlhJdFkyRkFNVFU1T0RZek56Y3dOakJaTUJNR0J5cUdTTTQ5CkFnRUdDQ3FHU000OUF3RUhBMElBQkdDVXY2WHRoQ2lGRVQySEowNm5ac1d5aFN4UTBvNmZ4NlBhNGJnc21qcmQKNUZzcThvNUt0UEUrTW92UjRhNERIdy9aZDh1TkNlSmNRb2lVRXByYms4V2pJekFoTUE0R0ExVWREd0VCL3dRRQpBd0lDcERBUEJnTlZIUk1CQWY4RUJUQURBUUgvTUFvR0NDcUdTTTQ5QkFNQ0EwZ0FNRVVDSUdaSTBNU3hteXN6ClppbFYwQWY2RzB6Ri8zOW1LWEdQTytYQ3VxK2E2L1FEQWlFQXFtbU93WFlXbWtPVGZONEF3eUg1ZjRaVDR1ZVkKY1dwVFVxQmtSdWMrM1RJPQotLS0tLUVORCBDRVJUSUZJQ0FURS0tLS0tCg==
    server: https://192.168.121.108:6443
  name: default
contexts:
- context:
    cluster: default
    user: default
  name: default
current-context: default
kind: Config
preferences: {}
users:
- name: default
  user:
    password: 1f9472d132670bd38c14c44ae7c8b415
    username: admin

Change server: https://192.168.121.108:6443 Point to the server where K3 is installed. Make sure that port 6443 is also accessible from the outside.

Transmitter

Once all your configurations look good, it’s time to start Lens and try to connect to our K3s cluster. The first page should look like the following. Click on + Log in to add a cluster.

A page similar to the following illustration will be displayed. In the drop-down menu labeled Kubeconfig, click the arrow, and you should see the default value for auto-discovery.

Installation lens-best Kubernetes dashboard and IDE

Installation lens-best Kubernetes dashboard and IDE

If you don’t find it by default, select “Customize” and paste the content similar to the one shown above into the text area that will be displayed below it. When finished, click “Add cluster“. If all goes well, your cluster details will look like this.

Installation lens-best Kubernetes dashboard and IDE

If you see the message “Metrics are not available due to missing or invalid Prometheus configuration…”, just right-click the cluster icon (large +) and click “Settings”.

Installation lens-best Kubernetes dashboard and IDE

There, install metrics and select Lens as the Prometheus installation method. This will deploy a Prometheus Pod to process the metrics.

Installation lens-best Kubernetes dashboard and IDE

After a few seconds, the dashboard should be filled with beautiful statistics and graphs.

Installation lens-best Kubernetes dashboard and IDE

View node

To view your nodes, simply click on your cluster and then click “Number of nodes“The menu provided.

Installation lens-best Kubernetes dashboard and IDE

View workload

The “Workload” tab has sub-menu items, such as Pod, Deployments, DaemonSets, etc., which you can view from the interface.

Installation lens-best Kubernetes dashboard and IDE

View network resources

Similarly, in “The internetIn the tab, “Endpoints, Portals, and Network Services” are displayed. Each configured service will also be visible here.

Installation lens-best Kubernetes dashboard and IDE

View pods and their logs

Lens can view pod logs without logging in to the cluster terminal, which makes Lens stand out. Just click “pod“Next “Workload. “From there, you should see all the pods, and on the far right of each pod, there are 3 vertical dots. Clicking on each will bring up other menu items, including “Log, Shell, Edit and Delete.”

Installation lens-best Kubernetes dashboard and IDE

Access node shell

Through the Lens interface, you can easily access the shell of the node. Click “Number of nodes“, and then on the far right of each node, click the three vertical dots, and then select the shell. As shown below, a terminal should be opened, and you can issue emergency commands without leaving Lens.

Installation lens-best Kubernetes dashboard and IDE

Final comment

As we have already emphasized, Lens is a standalone application for MacOS, Windows and Linux operating systems. Just like any other application in your favorite operating system. It can run on your laptop or PC, and then connect to the Kubernetes cluster for visibility, real-time statistics, log streaming, and hands-on troubleshooting, as we have briefly seen. As always, this guide is not exhaustive, as Lens provides more content. For other details about the lens, see Lens Kubernetes IDE homepage.

Learning materials:


Kubernetes for absolute beginners-hands-on

Kubernetes for absolute beginners-hands-on

★★★★★
(16831)

$ 15.49

$ 160.84

In stock

Buy now

Installation lens-best Kubernetes dashboard and IDEUdemy.com


Certified Kubernetes Administrator (CKA) and practice test

Certified Kubernetes Administrator (CKA) and practice test

★★★★★
(14535)

$ 15.49

$ 160.84

In stock

Buy now

Installation lens-best Kubernetes dashboard and IDEUdemy.com


Learn DevOps: The complete Kubernetes course

Learn DevOps: The complete Kubernetes course

★★★★☆
(11211)

$ 17.87

$47.65

In stock

Buy now

Installation lens-best Kubernetes dashboard and IDEUdemy.com


Docker and Kubernetes: The complete guide

Docker and Kubernetes: The complete guide

★★★★★
(30829)

$ 15.49

$119.14

In stock

Buy now

Installation lens-best Kubernetes dashboard and IDEUdemy.com

Finally, we will continue to thank you for your support and hope this guide is helpful to you. Check out more below.

Use K3 to deploy a lightweight Kubernetes cluster in 5 minutes

Use kubeadm to install Kubernetes cluster on Ubuntu 20.04

The top smallest container operating system running Kubernetes

Install and use Helm 3 on a Kubernetes cluster

Use kubectl and kubectx to easily manage multiple Kubernetes clusters

Use Ansible and Kubespray to deploy a ready Kubernetes cluster

To
You can download this article in PDF format via the link below to support us.

Download the guide in PDF format

turn off
To

To
To

Sidebar