Inspect Workloads in Headlamp
Headlamp is an extensible Kubernetes UI. The Workload Map plugin adds a Workloads page to Headlamp. The page lists the workloads of every type that has a definition, in one table, with a normalized status.
The plugin has no server-side component. It runs the Workload Map engine in your browser, compiled to WebAssembly, and it reads the cluster through Headlamp with your own credentials.
Prerequisites
- The Headlamp desktop app, connected to a cluster. The plugin targets the desktop app.
- The plugin running in Headlamp. For more information, refer to Run the Plugin from a Clone.
- Read access to the workloads that you want to see.
The Karta Operator is not required. The plugin uses the definitions in the built-in catalog, and the Karta definitions in the cluster when the CRD is installed.
Open the Workloads Page
In the Headlamp sidebar, select Karta > Workloads. The page is at the /karta/workloads route.
The table lists the workloads in the namespaces and clusters that you selected in Headlamp. A workload appears in the table when two conditions hold:
- A definition covers its type. The plugin merges the
Kartadefinitions in the cluster with the built-in catalog. A definition in the cluster overrides a catalog definition for the same group, version, and kind. - The cluster serves its type. The plugin asks the API server which types it serves, and it lists only those.
The table has the following columns:
Read the Status
The Status column shows the normalized statuses that match the workload. A workload can match more than one status at the same time, so a row can show more than one chip. The chips of a row appear from the most to the least severe:
When you sort the table by status, the sort uses the most severe status of each row.
If the plugin cannot compute the status of a workload, the row shows an Unavailable chip, and the reason appears when you point at it. If the engine fails to load, the page shows a warning with a Retry button above the table. The table keeps its rows, but the status of each workload is unavailable.
The page also shows a warning when it cannot read a cluster or a type, or when it has partial results for a cluster. The other rows stay in the table.
Filter the Table
The following columns have filters:
- Workload. A filter on the name.
- Type, Namespace, Status, and Cluster. A multi-select filter on the values.
For the Status filter, a row matches when it has any of the selected statuses.
Include Experimental Definitions
A definition with spec.experimental: true is excluded by default, from both the catalog and the cluster. To include experimental definitions, open Settings > Plugins > karta, turn on Enable experimental definitions, and save. Headlamp stores this setting in the profile of your current browser. If you turn the setting off, the workloads of experimental definitions leave the table.
The experimental setting is available in builds after v0.3.0.
Run the Plugin from a Clone
To run the plugin in Headlamp, build it from a clone of the repository. You need Node.js 22 or later, npm, and Go. Go builds the WebAssembly engine.
-
From the root of the repository, build the engine:
The command builds
karta-wasm/karta.wasmandkarta-wasm/wasm_exec.js. -
From the
headlamp-plugindirectory, install the dependencies and start the plugin:The
npm startcommand watchessrc/and rebuilds the plugin when a file changes. It copies the build files ofkarta-wasm/into the plugin directory of Headlamp.
Headlamp reads its plugin directory only at startup. After the first install, and whenever the set of files in the plugin directory changes, quit the Headlamp desktop app and open it again. Headlamp does not reload plugins while it runs. The plugin directory is ~/Library/Application Support/Headlamp/plugins/karta on macOS and ~/.config/Headlamp/plugins/karta on Linux.
If you edit karta-wasm/main.go, run make karta-wasm from the root of the repository again. Then save any file in src/, or restart npm start, to load the new binary. npm start does not watch the Go source.
Next Steps
- To learn how the engine evaluates a definition, refer to Core Concepts.
- To list the definitions that the plugin can use, refer to the Catalog of Definitions.
- To see the same information in a terminal, refer to Inspect Workloads with the CLI.