K8S Utility 3 - Graphical UI Lens
This article was last updated on: July 24, 2024 am
Opening
📜 introduction:
- Sharpen knives and do not chop wood by mistake
- Better tools make good work
- Article 1: 《One of the K8S utilities - How to merge multiple kubeconfig?》
- Part 2:K8S Utility II - Terminal UI K9S》
Like me,kubectl
It is not very slippery, and the following situations are often encountered:
- Forgot the order, knock first
--help
, and then knock the order, inefficient - Forgot to add
-n
Specify the namespace - Commands that are too long are often misremembered or mistyped, for example
kubectl exec -it...
- Logs and yaml cannot be copied out quickly
- For CRD resources, you can’t remember the CRD type and can’t find the relevant information
- You cannot grasp the health and monitoring status of the cluster
- The Windows machine command line is not easy to use
- …
If your working machine (front machine, springboard machine, operating machine, bastion machine…) ) is the Windows desktop environment. Then I highly recommend you to use this K8S utility: Graphical UI Lens。
📸 Introduction to Lens
Kubernetes IDE (Integrated Development Environment) for:
- exploitation
- debugging
- DevOps
- O&M
- monitor
Lens is the only IDE you need to control your Kubernetes cluster. It is built on an open source and free basis.
An IDE designed for those who work with Kubernetes every day, beautiful and powerful.
💪 Lens benefits
- 💡 Remove complexity: You don’t need to learn kubectl commands to explore and navigate Kubernetes clusters. It’s great for developers just starting out.
- 👁️ Real-time observability: View real-time statistics, events, and log streams. There are no spins to load, refresh or wait for the screen to update.
- 🔨 Positioning and debugging: Review the errors and warnings on the dashboard and click View Details. Click again to view the log or get the command line.
- 💻️ Run on your PCStandalone applications on MacOS, Windows and Linux. 1 minute installation. You don’t need to install anything in the cluster.
- 💚 Open source and free: Lens is based on an open-source platform with an active community and is supported by Kubernetes and cloud-native ecosystem pioneers.
- ⎈ Works with any Kubernetes: Using EKS, AKS, GKE, Minikube, Rancher, k0s, k3s, OpenShift…? All of them work properly. Just import kubeconfigs for the cluster you want to use.
Personal experience
Accessibility to use
Lens has oneUnified Catalog。 Bring all clusters, services, workloads, tools, automation, and related resources together for easy access.
And on Catalog, it’s easy to doBrowse and organize。 It’s easier than ever to use search, filtering, sorting, and tagging to access the resources you need to work on.
High efficiency
Lens features a column on the left called:Hotbar。 It is the main navigation that allows users to build their own “workflows” and “automations” in the desktop application. Users can customize items in Hotbar by assigning different labels, colors, and icons to facilitate recall. For example:
It also has VSCode-like onesCommand panel。 The command palette makes the most common tasks easier by allowing users to perform specific keyboard shortcuts. Improve accessibility and efficiency when using Lens. Windows shortcuts are:Ctrl + Shift + p
。 As shown in the following figure:
Monitor consolidation
Lens Built-in visualization。 Lens integrates with Prometheus to visualize and view trends in resource usage metrics, including CPU, memory, network, and disk, through total capacity, actual usage, requests, and limits. Automatically generate detailed visualizations for each k8s resource. As shown in the following figure:
All K8S resources are at your fingertips
Smart terminalsFunction. Lens smart terminals come with kubectl and helm, which automatically synchronize the version of kubectl to match the currently selected K8S cluster API version. Lens automatically assigns a kubeconfig context to match the currently selected K8s cluster.
K8S resource templates
Comes with a full K8S resource template, and it is a template with rich information, you can directly follow the cat on the template to complete the creation of various resources, and my mother no longer has to worry about me forgetting the Spec of K8S Resources!
Rapid deployment
Helm Chart。 Lens comes with Helm Chart Management, allowing you to discover and quickly deploy thousands of publicly available Helm Charts and manage your own repositories. Explore installed Helm Charts and revise and upgrade with a single click.
As shown in the following figure:
Plugins!
Support plugins。 Easily add Lens extensions from communities and cloud-native ecosystem vendors or build your own. Lens Extensions are used to add custom features and services to accelerate the development process for all technologies integrated with Kubernetes and other cloud-native technologies.
Here are a few useful plugins recommended:
lens-certificate-info
View certificate information. Viewing the secret with certificate information has the following effect:
lens-debug-tools
cooperate New features in K8S 1.16, you can insert a sidecar with a rich toolset in the pod you want to debug (in order to pursue Size, the general image is very streamlined, resulting in the lack of common commands and difficult debugging) to facilitate debugging.
You can also configure the image for debugging, and also intimately gave 3 recommendations:
Name | Description | Link |
---|---|---|
busybox | Default value | https://hub.docker.com/_/busybox |
markeijsermans/debug | https://hub.docker.com/r/markeijsermans/debug | |
praqma/network-multitool | https://hub.docker.com/r/praqma/network-multitool |
After the installation is complete, the pod page will have an additional button:
There are 2 modes:
One is “Run as debug pod”, which is to start a new pod on the same Node, which can be used to analyze and debug Node-related problems. The commands that are automatically executed are as follows:
1 |
|
The other is the “Run as emepheral container”, which requires the new features of K8S 1.16 to be enabled. Directly start a Debug sidecar in the pod to be debugged, you can analyze and debug problems related to Node and Pod. The commands that are automatically executed are as follows:
1 |
|
@nevalla/kube-resource-map
Resource topology diagram. This is really a favorite. Take a look at the topology diagram for Monitoring:
From Helm, to StatefulSet, to Pod, to SVC, to ConfigMap, Secret, you have it all.
✍ Summary.
Lens is oneKubernetes IDE, use it in a desktop environment for development, debugging, DevOps, operations, and monitoring.
It has a lot of powerful features, among them: Catalog, Hotbar, Command Palette, Monitoring, Smart Terminal, Resource Templates, Helm Chart Management, and Plugins These features must be tried and experience soaring!
Let’s use it together~ 🤓🤓🤓