Kubernetes

Headlamp: Kubernetes Dashboard Openlens Alternative

If you’re interested in Kubernetes, you’ve probably worked with various tools to manage your Kubernetes clusters. A new player in the field is Kubernetes Headlamp, an open-source project originally developed by Kinvolk (now part of Microsoft). With Headlamp, managing resources and maintaining a view of your Kubernetes cluster is much easier. This powerful tool reduces the learning curve of working with Kubernetes, providing a desktop app that brings the Kubernetes dashboard to your fingertips. Let’s delve into the details.

What is Headlamp?

Headlamp is designed to be an extensible Kubernetes web UI that delivers traditional functionality seen in other Kubernetes dashboards and IDEs but with an added twist.

It’s not just another Kubernetes IDE or access dashboard; Not only does it provide cluster metrics that most Kubernetes IDEs provide, but it also offers a unique plugin system that provides extra functionality beyond viewing basic metrics.

With Headlamp you get a tool to manage multiple Kubernetes clusters, visualize, and work with your individual Kubernetes resources, including networks, storage, etc, without having to find this information using the kubectl command line tool. You can easily view cluster resources in detail, allowing you to manage your cluster visually in your Kubernetes environment.

You can also manage Kubernetes environments security, including Kubernetes users (service accounts, roles, role bindings, etc).

Key features

  • A neutral and universal UI for Kubernetes, independent of specific vendors

  • Operational both within the cluster and as a standalone desktop application

  • Efficient management of multiple clusters

  • Customizable with extensibility through plugins

  • User role-specific UI controls to prevent unauthorized modification or deletion

  • Sleek and contemporary user interface

  • The ability to abort creation, update, or deletion processes as required

  • Comprehensive features including logs, exec, and resource editor with associated documentation

Installing Headlamp

Deploying Headlamp is straightforward. You can install it via a Helm repo directly from the source or use the installers on the GitHub repo. You can access the tool from a web interface if you deploy it directly to a Kubernetes cluster. However, it is also available as a desktop installation, as mentioned.

For Windows, you have the option to use Chocolatey as well.

Kubernetes Headlamp open source Kubernetes dashboard
Kubernetes Headlamp open source Kubernetes dashboard

If you choose not to build from source or use helm, full installers are available on the GitHub repo for Linux, Mac, and Windows. You can download it from here: Releases Β· headlamp-k8s/headlamp (github.com).

Download the installer for the Headlamp desktop Kubernetes IDE
Download the installer for the Headlamp desktop Kubernetes IDE

Below, I am using the Windows (AMD64) installer to install Headlamp in Windows 11.

Installation scope for Headlamp
Installation scope for Headlamp

Selecting the path of the installation.

Choose the Headlamp installation path
Choose the Headlamp installation path

Completing the setup.

Finish the Headlamp installation
Finish the Headlamp installation

Headlamp’s UI uses a user-friendly approach, presenting a default cluster view showing all the Kubernetes objects in your cluster.

To maintain multiple clusters, you can switch between different contexts easily. Headlamp uses your kubeconfig file for configurations, just like kubectl, which means no extra setup for the user. It supports any Kubernetes cluster, whether it’s Minikube on your local machine or a big multi-node cluster.

Service Account and Access to Resources

Headlamp uses a service account to access resources in your cluster by default. This account needs to have enough permissions to view metrics and other details.

The documentation provides step-by-step guidance on creating a service account with the right permissions. For instance, you can create a token that Headlamp uses to interact with your cluster.

Headlamp can be logged into using a client certificate or a bearer token. It also has the means to support external identity providers.

Creating a service account to access resources

Headlamp implements RBAC to interact with Kubernetes clusters, which is best practice. A Service Account token is recommended to log in to your Kubernetes cluster with Headlamp.

Let’s consider an example of creating a service account token to authenticate:

kubectl -n kube-system create serviceaccount headlamp-admin

Give admin rights to the account:

kubectl create clusterrolebinding headlamp-admin --serviceaccount=kube-system:headlamp-admin --clusterrole=cluster-admin

If you are running Headlamp in a Kubernetes cluster with version greater than 1.24, create the token using the following command:

kubectl create token headlamp-admin -n kube-system

Otherwise, run the following command to get the token associated with the service account:

export HEADLAMP_SECRET=$(kubectl get secrets --namespace kube-system -o custom-columns=":metadata.name" | grep "headlamp-admin-token")
kubectl get secret $HEADLAMP_SECRET --namespace kube-system --template={{.data.token}} | base64 --decode

Once you have the Service Account token, paste it when Headlamp prompts connecting to your cluster.

Using Headlamp

Once installed, Headlamp can be launched as a desktop app, enabling you to access resources like your Kubernetes objects from your desktop. Headlamp will read from your existing kubeconfig file if you have one and will display clusters you have contained there.

Choose the cluster you want to connect to
Choose the cluster you want to connect to

However, it doesn’t just use kubeconfig authentication method for accessing your cluster. When you click a cluster to connect, it will prompt you for the ID token. This is the token you created above using the kubectl create token command.

Token ID for Kubernetes cluster authentication
Token ID for Kubernetes cluster authentication

The Headlamp dashboard displays the cluster health overview after launching the tool with a sample user token.

Cluster metrics in the Headlamp dashboard
Cluster metrics in the Headlamp dashboard

The interface contains the options below:

  • Cluster

  • Workloads

  • Storage

  • Network

  • Security

  • Configuration

  • Apps

Viewing Kubernetes namespaces using Headlamp
Viewing Kubernetes namespaces using Headlamp

Extensible with Plugins

The key feature that sets Headlamp apart from traditional Kubernetes dashboards is its extensive plugin system. Developers can create plugins to extend the functionality of Headlamp, offering features that go beyond the default cluster view.

For example, while you can view namespaces and resources out of the box, a plugin might provide a more detailed view or additional metrics. The plugin system allows you to customize Headlamp to fit your needs and workflows, making it a truly extensible Kubernetes web UI.

Comparing with Other Tools

Comparing Headlamp to other Kubernetes tools like Lens Desktop, developed initially by cloud-native ecosystem pioneers, can be interesting. While Lens focuses on providing a read-write interface to your cluster for modifying individual Kubernetes resources, Headlamp, with its plugin system, is designed to be extensible and readily provide access to your cluster data.

Some have been turned off of Lens recently with the nags for upgrading to the paid version of Lens. The Open Lens project is another alternative to Lens as well and is a solution I have written about here:

It lets you maintain a robust and detailed view of your cluster, focusing on providing a powerful visual interface. Depending on your needs, you might find one tool more appealing.

Check out my video on Openlens here:

Openlens IDE

Frequently Asked Questions

1. What sets Headlamp apart from other Kubernetes dashboards like Lens?

While several Kubernetes dashboards are available, Headlamp differentiates itself with its plugin system. This means the tool can be extensively customized for different needs, enabling developers to add extra functionality to enhance their Kubernetes cluster management.

2. Can I use Headlamp as a learning tool for Kubernetes?

Headlamp is designed to be intuitive and user-friendly, helping reduce the steep learning curve often associated with Kubernetes. It can be an effective hands-on learning tool by offering visual access to resources and the ability to interact directly with Kubernetes objects.

3. What platforms can I run Headlamp on?

Headlamp can be installed on several platforms, including Linux, Windows, and Mac. You can build and run it for your specific platform as a desktop application, making Kubernetes cluster management a breeze from your workstation.

4. What additional setup is needed to deploy Headlamp on my Kubernetes cluster?

To start with Headlamp, you must install the necessary dependencies, such as Node.js, Go, and Make. You’ll also need access to a Kubernetes cluster, for which Minikube is a good option. Then, you can use the provided ‘make’ commands to build and run the code or build a container image.

5. I need some specific features in my Kubernetes UI. Can Headlamp accommodate this?

Thanks to its plugin system, Headlamp can be customized. You can create plugins to add any specific functionality, from additional views to complex management features. This makes Headlamp one of the most adaptable Kubernetes dashboards available.

Wrapping Up

Headlamp is a powerful and flexible tool for managing Kubernetes. Headlamp provides an impressive Kubernetes IDE that can simplify your work whether you’re a beginner or an experienced user.

It contains a powerful plugin system, traditional functionality, and the ability to maintain a detailed cluster view, making Headlamp a great addition to your Kubernetes toolkit.

Subscribe to VirtualizationHowto via Email πŸ””

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

Brandon Lee

Brandon Lee is the Senior Writer, Engineer and owner at Virtualizationhowto.com and has over two decades of experience in Information Technology. Having worked for numerous Fortune 500 companies as well as in various industries, Brandon has extensive experience in various IT segments and is a strong advocate for open source technologies. Brandon holds many industry certifications, loves the outdoors and spending time with family.

Related Articles

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.