backend/frontend/charts: make in-cluster context name configurable#4362
backend/frontend/charts: make in-cluster context name configurable#4362illume merged 8 commits intokubernetes-sigs:mainfrom
Conversation
There was a problem hiding this comment.
Pull request overview
This PR makes the in-cluster context name configurable in Headlamp and enhances the browser tab title to include the active cluster name, addressing the need for better multi-cluster environment support.
Changes:
- Added
--in-cluster-context-nameCLI flag (default: "main") to customize the in-cluster context name - Updated browser tab title format to include cluster name:
<cluster> - <page> - Renamed constant from
InClusterContextNametoDefaultInClusterContextNamefor clarity
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
frontend/src/components/App/RouteSwitcher.tsx |
Modified PageTitle component to include cluster name in browser tab title |
backend/pkg/kubeconfig/kubeconfig.go |
Renamed constant and added contextName parameter to GetInClusterContext function with empty string handling |
backend/pkg/headlampconfig/headlampConfig.go |
Added InClusterContextName field to HeadlampCFG struct with documentation |
backend/pkg/config/config.go |
Added InClusterContextName field and CLI flag definition with default value "main" |
backend/cmd/server.go |
Passed InClusterContextName from config to HeadlampConfig |
backend/cmd/headlamp.go |
Added InClusterContextName field and passed it to GetInClusterContext function |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
illume
left a comment
There was a problem hiding this comment.
This looks pretty good a first glance. Thanks a lot!
@iamhalje can you please rebase the PR against main branch? It seems like some older commits are mixed in here. Also please get rid of the merge commit.
Please see Commit Guidelines , we follow a linux kernel style of commit messages.
For example:
frontend: HomeButton: Fix so it navigates to home
backend: config: Add enable-dynamic-clusters flag
Seems there's some lint issue in the backend/ code (I think it is just a comment typo). You can run the linter locally like this:
npm run backend:lint
npm run backend:format
21d9b0e to
4615b04
Compare
935208a to
32f065e
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
015f89b to
32f065e
Compare
|
@illume fixed, can rerun pipelines |
|
@illume I can finish this today and fix remaining issues |
d5369fd to
cb8a463
Compare
|
@illume fixed all |
023162b to
044867f
Compare
|
@illume bump |
There was a problem hiding this comment.
Thanks @iamhalje
It seems the chart test is failing in the github check.
You can run it locally like this:
make helm-template-test
Template test FAILED for ./charts/headlamp/values.yaml against ./charts/headlamp/tests/expected_templates/default.yaml:
--- ./charts/headlamp/tests/defaultvaluetest/rendered_templates.yaml 2026-01-26 16:18:43.176857421 +0000
+++ ./charts/headlamp/tests/expected_templates/default.yaml 2026-01-26 16:18:40.210852348 +0000
@@ -109,7 +109,6 @@
env:
args:
- "-in-cluster"
- - "-in-cluster-context-name=main"
- "-plugins-dir=/headlamp/plugins"
# Check if externalSecret is disabled
ports:
Please squash or rebase this merge main commit out?
8a4db75 to
45e85ea
Compare
45e85ea to
c7ccea1
Compare
|
@illume helm-template-test passed |
|
@illume what need to be done to get lgtm label? |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: iamhalje, illume The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Summary
this PR makes Headlamp's in-cluster cluster name configurable and includes the selected cluster name in the browser tab title. (this help with to many tabs)
Related Issue
Fixes #4346
Changes
Backend:
--in-cluster-context-name/HEADLAMP_CONFIG_IN_CLUSTER_CONTEXT_NAMEto override the in-clustter context name (default main).Frontend:
Steps to Test
headlamp-server --in-cluster --in-cluster-context-name=dev<cluster> - <page>(or when page title is empty)Screenshots (if applicable)