Headlamp Documentation
repository·main·Indexed 27 days ago
https://github.com/kubernetes-sigs/headlampHeadlamp is an extensible, vendor-independent Kubernetes web UI for managing multi-cluster environments. It supports in-cluster deployment via Helm and local desktop usage via an Electron app. Key features include resource editing, logs, exec, plugin extensibility, OIDC authentication, and integration with Backstage. The documentation covers installation, development setup, e2e testing with Playwright, and telemetry configuration using Jaeger and Prometheus.
What's inside Headlamp
- The Headlamp Frontend is a React-based application that serves as the user interface for Headlamp. It provides the visual layer for interacting with Kubernetes clusters.
Overview of Headlamp Plugins
mainHeadlamp plugins allow you to customize and extend the Kubernetes web interface without maintaining a fork of the project. They enable developers and vendors to add custom functionality, UI elements, and integrations directly into the Headlamp experience.Use the lib/k8s/ingress module
mainThelib/k8s/ingressmodule provides classes and interfaces for working with Kubernetes Ingress resources within Headlamp. It includes theIngressclass for managing ingress logic and several interfaces (IngressBackend,IngressRule, andKubeIngress) that define the structure of Ingress rules and backends.Load testing Headlamp
mainThe@kinvolk/headlamp-load-testspackage contains scripts designed to perform load testing on Headlamp. For detailed information on testing procedures and setup, refer to the official development testing documentation.Use the lib/k8s/runtime module
mainThelib/k8s/runtimemodule provides classes and interfaces for interacting with Kubernetes runtime-related resources within Headlamp. It includes theRuntimeClassclass and theKubeRuntimeClassinterface.Use the lib/k8s/endpoints module
mainThelib/k8s/endpointsmodule provides classes and interfaces for interacting with Kubernetes Endpoints within Headlamp. It includes theEndpointsclass for managing endpoint data and several interfaces (KubeEndpoint,KubeEndpointAddress,KubeEndpointPort, andKubeEndpointSubset) that define the structure of Kubernetes endpoint objects.Understand Map View concepts: Nodes, Edges, and Sources
mainHeadlamp's Map view renders cluster resources as an interactive graph using three building blocks:
- Node: A single resource displayed on the map (e.g., a Pod or Deployment).
- Edge: A directed relationship between two nodes (e.g., a ReplicaSet owning a Pod).
- Source: A named collection of nodes and edges (e.g., "My Pods" or "KEDA ScaledObjects").
Plugins can register their own sources to teach the map about resources Headlamp doesn't know about by default, such as Custom Resource Definitions (CRDs) or plugin-managed resources.
Use the lib/k8s/hpa module
mainThelib/k8s/hpamodule provides classes and interfaces for interacting with Kubernetes Horizontal Pod Autoscaler (HPA) resources within Headlamp. It includes theHPAclass for managing HPA objects and interfaces likeKubeHPAandCrossVersionObjectReferenceto ensure type safety when working with HPA data structures.Use the @kinvolk/headlamp-plugin library
mainThe
@kinvolk/headlamp-pluginmodule provides the@kinvolk/headlamp-plugin/liblibrary for Headlamp development. Key modules include:- K8s: Kubernetes functionality.
- Headlamp: Used to register plugins.
- CommonComponents: Shared React components used in the Headlamp UI.
- Notification: Provides the
Notificationclass for creating notifications andsetNotificationsInStoreto display them in Headlamp. - Router: For getting or generating routes.
Summary of Kubernetes data fetching approaches
mainWhen developing a Headlamp plugin, choose the appropriate method for fetching data based on your requirements:
Approach Best For Example getCluster()Getting current cluster context Display cluster name K8s.ResourceClassesStandard Kubernetes resources List namespaces, nodes ApiProxy.request()Custom endpoints, raw API calls Fetch API server version Use the lib/k8s/namespace module
mainThelib/k8s/namespacemodule provides abstractions for working with Kubernetes namespaces within Headlamp. It includes theNamespaceclass and theKubeNamespaceinterface to represent and manipulate namespace data.Use the lib/k8s/event module
mainThelib/k8s/eventmodule provides abstractions for working with Kubernetes events within Headlamp. It includes theEventclass and theKubeEventinterface to represent and manipulate event data.