Lens is a complicated open-source Kubernetes dashboard which gives a graphical view into your cluster. In contrast to different dashboards, Lens is an Electron-based desktop utility which you put in in your machine. It connects to your cluster utilizing your current Kubeconfig recordsdata.
Pre-compiled Lens binaries can be found from the project’s website. There are alternatives for Home windows, macOS, and several other flavors of Linux. You’ll be able to choose from Debian, Fedora, Snap, and AppImage distribution codecs.
Obtain and run the suitable installer. Launch Lens out of your working system’s functions listing to get began.
Connecting to Clusters
Lens maintains a “catalog” of clusters you’ll be able to hook up with. It’ll routinely uncover your current Kubectl connections by way of the recordsdata in your
$HOME/.kube listing. Click on the “Browse Clusters in Catalog” button on the launch web page to begin a connection.
The Catalog shows the whole lot Lens can examine. Click on one of many clusters within the listing to view its particulars. Subsequent, click on the hyperlink icon within the top-right to open a connection.
Lens defaults to displaying a cluster overview display that permits you to visualize Kubernetes exercise. You’ll see metrics out of your management aircraft and employee nodes, together with graphs of CPU, reminiscence, and pod exercise. A panel additional down will spotlight any potential points together with your cluster.
You’ll be able to hook up with new clusters by clicking the house button within the top-left to entry the Catalog. Click on the blue “+” button within the bottom-right to select a
kubeconfig file to import. This allows you to use arbitrary settings recordsdata you’ve downloaded, saved on a community share, or stored in a undertaking repository.
Lens solely works with Kubeconfig recordsdata and there’s no graphical interface for including a brand new cluster. If you wish to begin with a clear file, press Ctrl+Shift+A to deliver up an editor. This can allow you to sort or paste the content material of a Kubeconfig file. Click on the “Add clusters” button on the backside so as to add the connection to your Catalog.
Utilizing the Hotbar
Steadily used clusters might be pinned to your hotbar. That is the vertical strip of icons down the left of the window. To begin with, solely the Catalog is pinned to the hotbar, within the first slot. You’ll be able to unpin it by right-clicking and selecting “Unpin from Hotbar”.
Gadgets are pinned from throughout the Catalog. Click on the three dots icon to the appropriate of an merchandise, then click on “Pin to Hotbar”. It’ll transfer into the subsequent accessible hotbar slot. You’ll be able to rearrange your hotbar by dragging gadgets round.
You’ll be able to shortly leap between clusters in your hotbar by clicking their icons. The best-click menu exposes share, settings, and delete choices to allow you to handle your connections. You’ll be able to entry these things for clusters that aren’t within the hotbar by going to the Catalog, then clicking the three dots icon subsequent to any merchandise. The Catalog might be reached at any time by urgent Ctrl+Shift+C.
Working With Clusters
Lens gives highly effective cluster administration performance which extends past that provided by the official web-based dashboard. You’ll be able to examine all of the sources operating inside your cluster, starting from easy Pods and Deployments to the customized sorts added by your functions.
When you’ve received a cluster chosen, Lens exhibits totally different classes of useful resource in its left pane. This strategy differs barely from different dashboards which have a tendency to supply a namespace-oriented view. In Lens you see logical teams of sources, as a substitute of Kubernetes object names. Therefore there’s dropdowns for “Community”, “Storage,” and “Apps” in a way that helps Kubernetes newcomers get acquainted with totally different useful resource sorts.
When you’ve expanded a class you do get to see Kubernetes object sorts. Inside “Workloads” you’ve received sub-views for Pods, Deployments, ReplicaSets, Jobs, and different associated sources. Every useful resource sort shows in a tabulated view which defaults to displaying all gadgets in each namespace.
You’ll be able to filter the outcomes to a single namespace utilizing the dropdown on the high of the display. The desk additionally gives a searchbar and customizable columns. Click on the three dots icon to the appropriate of the header row so as to add or take away columns you’ll want to see. This characteristic helps you concentrate on the data you’re serious about.
Every merchandise in a desk has its personal choices too. These will range relying on the useful resource sort you’re viewing. Within the case of a Pod, you’ll be able to connect to its course of, get a shell contained in the Pod, view its logs, or edit its manifest.
Every operate brings up a brand new pane within the backside panel. Most panes have their very own choices that allow you to filter the outcomes or regulate the output’s formatting. You’ll be able to collapse the panel part by clicking the downwards-pointing arrow on the tab strip. The neighboring button expands the panel to fill your entire display.
Panes open in tabs which you’ll freely change between. Clicking the brand new tab button permits you to launch a neighborhood terminal session or create a useful resource contained in the cluster.
The latter possibility opens a YAML editor the place you’ll be able to sort or paste a useful resource manifest. Templates for in style useful resource sorts can be found from the drop-down menu within the toolbar. Click on “Create & Shut” so as to add the brand new useful resource to your cluster.
Customized useful resource sorts are uncovered within the the “Customized Sources” part on the backside of the left sidebar. Submenus allow you to drill down into particular person sorts and examine the sources utilizing every one. You’ll be able to edit and delete customized sources and their sorts with the common three dot menu.
Lens has a number of customization choices accessed by urgent Ctrl+Comma. The preliminary settings display permits you to change the UI theme, timezone, and shell path utilized by native terminal cases.
The “Kubernetes” tab is for managing cluster operations. The primary setting on this display, “Kubectl binary obtain”, controls the Kubectl model utilized by Lens. By default Lens will obtain a Kubectl model that’s appropriate in your cluster’s Kubernetes launch. You’ll be able to disable this performance utilizing the inexperienced toggle button. Downloaded Kubectl releases will probably be added to the listing proven in “Listing for Binaries”.
The “Kubeconfig Syncs” listing defines directories which Kubectl will examine for Kubeconfig recordsdata. Matching recordsdata will probably be added to your Catalog routinely. This defaults to your
The ultimate “Helm Charts” part permits you to add new Helm repositories. You’ll be able to set up charts from these repositories by increasing the Apps > Charts menu in your cluster’s administration display. Out there charts will probably be displayed; choose one and click on “Set up” so as to add it to your cluster.
Lens helps extensions which may add additional performance. Press Ctrl+Shift+E so as to add a brand new extension. Enter a URL or choose a downloaded extension archive out of your filesystem. Press the blue “Set up” button to allow the extension.
There’s at the moment solely a handful of extensions available. They principally concentrate on including compatibility with particular vendored Kubernetes installations. There’s additionally a Certificate Info extension which may floor certificates expiration occasions throughout the Lens interface.
You’ll be able to write your personal extensions too utilizing Lens’ documented APIs. They help including new object particulars, creating customized pages, including standing bar gadgets, and different UI modifications. Extensions might be revealed to npm to generate a tarball hyperlink which Lens’ set up display can reference.
Lens is a feature-filled graphical interface for Kubernetes clusters. It permits you to work with a number of connections concurrently and exposes all of the sources inside every cluster.
In contrast with different dashboards, Lens has a big limitation because it’s a desktop-bound utility. You received’t be capable to harness its energy in your cellular units.
Nonetheless this weak point can be a key energy: in contrast to the official dashboard, you don’t have to setup proxies or expose an online service, as Lens makes use of your current Kubectl config recordsdata. This makes it a safer possibility than operating a web-based dashboard inside your cluster.
Lens is geared toward Kubernetes directors and operations groups which want a extra subtle administration expertise. Builders will really feel at house too – with its Command Palette (accessed by way of Ctrl+Shift+P), Lens is a keyboard-friendly selection which borrows closely from trendy IDE experiences. It’s a worthwhile possibility if you happen to’ve outgrown less complicated dashboards and don’t wish to be working with Kubectl instructions and manifests.