Skip to content

[scalar-manager] Add Headlamp integration support#325

Open
thongdk8 wants to merge 2 commits intomainfrom
feat/sm-add-headlamp
Open

[scalar-manager] Add Headlamp integration support#325
thongdk8 wants to merge 2 commits intomainfrom
feat/sm-add-headlamp

Conversation

@thongdk8
Copy link
Contributor

@thongdk8 thongdk8 commented Feb 3, 2026

Description

This PR adds Headlamp integration support to the Scalar Manager Helm chart. Headlamp is a Kubernetes web UI that can be embedded within Scalar Manager to provide cluster visualization and management capabilities.

Related issues and/or PRs

N/A

Changes made

  • Add scalarManager.headlamp configuration section in values.yaml with:
    • enabled flag to toggle Headlamp integration
    • kubernetes settings for service discovery (label name/value, port name)
    • serviceAccount settings for token generation
    • web settings for proxy configuration (base path, namespace, cache TTL)
  • Add helper templates for Headlamp ServiceAccount naming in _helpers.tpl
  • Add ServiceAccount and ClusterRoleBinding (cluster-admin) for Headlamp token generation
  • Add permission to create tokens for Headlamp ServiceAccount in ClusterRole
  • Add environment variables for API container (service discovery) and Web container (proxy config)
  • Update values.schema.json with Headlamp configuration schema

Checklist

  • I have commented my code, particularly in hard-to-understand areas.
  • I have updated the documentation to reflect the changes.
  • Any remaining open issues linked to this PR are documented and up-to-date (Jira, GitHub, etc.).
  • Tests (unit, integration, etc.) have been added for the changes.
  • My changes generate no new warnings.
  • Any dependent changes in other PRs have been merged and published.

Additional notes (optional)

NA

Release notes

Added Headlamp integration support to Scalar Manager for embedded Kubernetes cluster visualization.

@gemini-code-assist
Copy link

Summary of Changes

Hello @thongdk8, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly enhances scalar-manager by introducing robust integration capabilities with Headlamp, a Kubernetes UI. The changes involve adding new Helm chart configurations to control Headlamp's enablement and behavior, establishing a dedicated ServiceAccount with cluster-admin permissions for secure token generation, and injecting necessary environment variables into the scalar-manager API and Web containers to facilitate Headlamp service discovery and proxying. This allows users to seamlessly connect scalar-manager with a deployed Headlamp instance for improved Kubernetes cluster management.

Highlights

  • Headlamp Integration: Introduced comprehensive support for integrating the Headlamp Kubernetes UI, allowing scalar-manager to interact with and manage Headlamp.
  • Dedicated ServiceAccount: Implemented the creation of a dedicated Kubernetes ServiceAccount for Headlamp, which is granted cluster-admin privileges to facilitate token generation for Headlamp login.
  • Configurable Options: Added new Helm chart values (scalarManager.headlamp.*) to enable and configure various aspects of the Headlamp integration, including service discovery, service account details, and web proxy settings.
  • Environment Variable Configuration: Configured both the API and Web containers of scalar-manager to consume Headlamp-specific environment variables for service discovery and proxy settings, enabling seamless communication.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Changelog
  • charts/scalar-manager/README.md
    • Updated documentation to detail the new scalarManager.headlamp configuration parameters and their usage.
  • charts/scalar-manager/templates/_helpers.tpl
    • Introduced new helper templates (headlampServiceAccountName, headlampServiceAccountNamespace) for consistent naming and namespace resolution of the Headlamp ServiceAccount.
  • charts/scalar-manager/templates/scalar-manager/clusterrole.yaml
    • Modified the ClusterRole to conditionally grant permission for the Headlamp ServiceAccount to create serviceaccounts/token resources, essential for authentication.
  • charts/scalar-manager/templates/scalar-manager/clusterrolebinding.yaml
    • Added a conditional ClusterRoleBinding to assign cluster-admin privileges to the newly created Headlamp ServiceAccount.
  • charts/scalar-manager/templates/scalar-manager/deployment.yaml
    • Extended the API and Web container definitions to conditionally include environment variables for Headlamp service discovery and proxy configuration, respectively.
  • charts/scalar-manager/templates/scalar-manager/serviceaccount.yaml
    • Implemented conditional creation of the dedicated Headlamp ServiceAccount based on chart values.
  • charts/scalar-manager/values.schema.json
    • Updated the Helm values schema to formally define the structure and types for all new scalarManager.headlamp configuration options.
  • charts/scalar-manager/values.yaml
    • Added default values for the new scalarManager.headlamp configuration block, with Headlamp integration disabled by default.
Activity
  • No specific activity (comments, reviews, progress updates) has been provided for this pull request.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces Headlamp integration support for the scalar-manager Helm chart. The changes are comprehensive, adding new values, documentation, and Kubernetes resources like a ServiceAccount, ClusterRole, and ClusterRoleBinding to facilitate this integration. While the implementation is largely correct, there is a critical security concern regarding the granting of cluster-admin privileges to the Headlamp service account. This should be carefully reconsidered to adhere to the principle of least privilege. A minor documentation improvement is also suggested.

namespace: {{ include "scalar-manager.headlampServiceAccountNamespace" . }}
roleRef:
kind: ClusterRole
name: cluster-admin

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

security-critical critical

Granting cluster-admin privileges to the Headlamp service account introduces a significant security risk. This provides unrestricted access to the entire cluster, and a compromise of this service account's token could lead to a full cluster compromise. It is highly recommended to follow the principle of least privilege and define a more restrictive ClusterRole with only the permissions that Headlamp requires.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To be able to fully utilize the Headlamp features, the service account that is used for Headlamp should be bound to the cluster-admin role, so we did that on purpose.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Regarding this point, I have three questions:

1. The number of Service Accounts used for access to Headlamp

Please let me confirm the design of the access pattern for Headlamp through Scalar Manager from the user role perspective.

Which of the following is the designed behavior in Scalar Manager?

  • Pattern 1 (Share one service account in all Scalar Manager users)

                                    +---[Scalar Manager]------------------+
                                    |                                     |
    [User A (ADMINISTRATOR)]---+    |                                     |
                               |    |                                     |
    [User B (WRITER)]----------+--->+---[Headlamp Integration Feature]--->+---(Share one SA with `cluster-admin`)--->[Headlamp]---(Monitor Kubernetes Resources)--->[Kubernetes]
                               |    |                                     |
    [User C (READER)]----------+    |                                     |
                                    |                                     |
                                    +-------------------------------------+
    
  • Pattern 2 (Generate dedicated service account for each Scalar Manager user)

                                    +---[Scalar Manager]------------------+
                                    |                                     |
    [User A (ADMINISTRATOR)]------->+---[Headlamp Integration Feature]--->+---(Dedicated SA `user-a` with `cluster-admin`)---+
                                    |                                     |                                                  |
    [User B (WRITER)]-------------->+---[Headlamp Integration Feature]--->+---(Dedicated SA `user-b` with `edit`)------------+--->[Headlamp]---(Monitor Kubernetes Resources)--->[Kubernetes]
                                    |                                     |                                                  |
    [User C (READER)]-------------->+---[Headlamp Integration Feature]--->+---(Dedicated SA `user-c` with `view`)------------+
                                    |                                     |
                                    +-------------------------------------+
    
  • Pattern 3 (Generate shared service account for each Scalar Manager role)

                                    +---[Scalar Manager]------------------+
                                    |                                     |
    [User A (ADMINISTRATOR)]------->+---[Headlamp Integration Feature]--->+---(Shared SA `scalar-manager-admin` with `cluster-admin`)----+
                                    |                                     |                                                              |
    [User B (WRITER)]-------------->+---[Headlamp Integration Feature]--->+---(Shared SA `scalar-manager-writer` with `edit`)------------+
                                    |                                     |                                                              |
    [User C (WRITER)]-------------->+---[Headlamp Integration Feature]--->+---(Shared SA `scalar-manager-writer` with `edit`)------------+--->[Headlamp]---(Monitor Kubernetes Resources)--->[Kubernetes]
                                    |                                     |                                                              |
    [User D (READER)]-------------->+---[Headlamp Integration Feature]--->+---(Shared SA `scalar-manager-reader` with `view`)------------+
                                    |                                     |                                                              |
    [User E (READER)]-------------->+---[Headlamp Integration Feature]--->+---(Shared SA `scalar-manager-reader` with `view`)------------+
                                    |                                     |
                                    +-------------------------------------+
    

2. The default role for access to Headlamp

It seems that the service account for Headlamp has the cluster-admin role. However, I think it's too strong as a default value.

Especially, if the designed access pattern in Q1 is Pattern 1 (Share one service account in all Scalar Manager users), normal users, even though READER, have full access, including any update operations of the Kubernetes cluster through Headlamp.

I think it's not good from the perspective of the principle of least privilege. It seems that similar discussions exist on the Headlamp side as follows:

Therefore, I think it would be better to:

  1. Set the view role as a default, and make it configurable in the values.yaml file.
    • I think we should also discuss whether a configurable role is really necessary or not.
  2. Or, define fine-grained custom roles for Scalar Manager users based on Scalar Manager roles, ADMINISTRATOR, WRITER, and READER.

Also, users can use the generated token on the Scalar Manager page to access the Kubernetes cluster through other tools like the kubectl command. Therefore, we need to treat the generated token very carefully. Sorry, I overlooked this point when I talked about the rough design before, but I think we should reconsider this point again.

3. The purpose of Headlamp integration in Scalar Manager

This is related to the 2. The default role for access to Headlamp, but I'd like to confirm the purpose of the Headlamp integration.

I think Scalar Manager is almost a monitoring tool, for now. And, I think we decided to integrate Headlamp as an alternative to the CPU or Memory panel at the top page of Scalar Manager that existed in the prior implementation. In such a case, I think it's enough to provide integration with Headlamp only with read operations. In other words, I think we don't need to provide the way to create, update, and delete operations for Kubernetes resources through Scalar Manager.

I'd like to clarify the goal of the Headlamp integration and consider what role we need carefully. What is the purpose of this Headlamp integration?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@feeblefakie
As I shared in the meeting, I think we need additional discussions about design based on this thread.

Please let me discuss these points with you and the middleware team later. 🙏

@thongdk8 thongdk8 force-pushed the feat/sm-add-headlamp branch from 49245e9 to 55343e7 Compare February 3, 2026 08:49
Add configuration options for integrating with Headlamp Kubernetes UI:
- Service discovery configuration for locating Headlamp services
- Dedicated ServiceAccount with cluster-admin for token generation
- Environment variables for API and Web containers
- Schema and documentation updates
@thongdk8 thongdk8 force-pushed the feat/sm-add-headlamp branch from 55343e7 to 6dfc067 Compare February 3, 2026 08:50
@thongdk8 thongdk8 self-assigned this Feb 3, 2026
@thongdk8 thongdk8 added the enhancement New feature or request label Feb 3, 2026
@thongdk8 thongdk8 requested a review from Copilot February 3, 2026 09:14
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds Headlamp integration support to the Scalar Manager Helm chart, allowing Scalar Manager to embed Headlamp (a Kubernetes web UI) for cluster visualization and management capabilities. The integration is disabled by default and requires explicit enablement.

Changes:

  • Added comprehensive Headlamp configuration section in values.yaml covering service discovery, service account settings, and proxy configuration
  • Created dedicated ServiceAccount and ClusterRoleBinding for Headlamp with cluster-admin privileges
  • Added environment variables to API and Web containers for service discovery and proxy configuration

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
charts/scalar-manager/values.yaml Added headlamp configuration section with kubernetes discovery, serviceAccount, and web proxy settings
charts/scalar-manager/values.schema.json Added JSON schema validation for headlamp configuration structure
charts/scalar-manager/templates/_helpers.tpl Added helper templates for Headlamp ServiceAccount name and namespace resolution
charts/scalar-manager/templates/scalar-manager/serviceaccount.yaml Added conditional ServiceAccount creation for Headlamp
charts/scalar-manager/templates/scalar-manager/clusterrolebinding.yaml Added ClusterRoleBinding granting cluster-admin role to Headlamp ServiceAccount
charts/scalar-manager/templates/scalar-manager/clusterrole.yaml Added permission to create tokens for Headlamp ServiceAccount
charts/scalar-manager/templates/scalar-manager/deployment.yaml Added environment variables for Headlamp configuration to API and Web containers
charts/scalar-manager/README.md Auto-generated documentation updates for new Headlamp configuration options

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

subjects:
- kind: ServiceAccount
name: {{ include "scalar-manager.headlampServiceAccountName" . }}
namespace: {{ include "scalar-manager.headlampServiceAccountNamespace" . }}
Copy link

Copilot AI Feb 3, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The ServiceAccount subject is missing the apiGroup field. For consistency with the existing ClusterRoleBinding in this file (line 11), add 'apiGroup: ""' to the subject specification. While this field is optional for ServiceAccounts and defaults to an empty string, it's better to be explicit for consistency and clarity.

Suggested change
namespace: {{ include "scalar-manager.headlampServiceAccountNamespace" . }}
namespace: {{ include "scalar-manager.headlampServiceAccountNamespace" . }}
apiGroup: ""

Copilot uses AI. Check for mistakes.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have specified in the cluster roles already

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To keep the consistency in this chart, could you please add apiGroup: "" for now?
If we omit apiGroup: "" here, I think we should apply the same thing in other places in this chart.

Comment on lines +14 to +20
{{- if .Values.scalarManager.headlamp.enabled }}
# Permission to create tokens for Headlamp ServiceAccount
- apiGroups: [""]
resources: ["serviceaccounts/token"]
verbs: ["create"]
resourceNames: ["{{ include "scalar-manager.headlampServiceAccountName" . }}"]
{{- end }}
Copy link

Copilot AI Feb 3, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The ClusterRole adds token creation permission for the Headlamp ServiceAccount whenever headlamp is enabled, but doesn't verify that the ServiceAccount is actually being created. If headlamp.enabled is true but serviceAccount.create is false and no custom serviceAccount.name is provided, this could result in referencing a non-existent ServiceAccount in the resourceNames field.

Consider updating the condition to check both enabled and create flags, or add validation to ensure a ServiceAccount name is provided when create is false.

Copilot uses AI. Check for mistakes.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can refer to an existing service account as well. This is made on purpose

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems that we can set the following configuration and deploy Scalar Manager without any errors (i.e., we can run the helm install command without errors).

scalarManager:
  headlamp:
    enabled: true
    serviceAccount:
      create: false
      name: ""

However, in the above deployment, it seems that the Generate Token button shows an error when I click it on the UI.

Could you please confirm whether this behavior is expected or not?

(I will share more details in internal Slack later.)

@thongdk8 thongdk8 marked this pull request as ready for review February 3, 2026 09:36
Copy link
Contributor

@feeblefakie feeblefakie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thank you!

Copy link
Collaborator

@kota2and3kan kota2and3kan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the updates!
I left several comments, and I think we need additional discussions about the design of Scalar Manager itself.
Could you please take a look when you have time? 🙇

Comment on lines +14 to +20
{{- if .Values.scalarManager.headlamp.enabled }}
# Permission to create tokens for Headlamp ServiceAccount
- apiGroups: [""]
resources: ["serviceaccounts/token"]
verbs: ["create"]
resourceNames: ["{{ include "scalar-manager.headlampServiceAccountName" . }}"]
{{- end }}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems that we can set the following configuration and deploy Scalar Manager without any errors (i.e., we can run the helm install command without errors).

scalarManager:
  headlamp:
    enabled: true
    serviceAccount:
      create: false
      name: ""

However, in the above deployment, it seems that the Generate Token button shows an error when I click it on the UI.

Could you please confirm whether this behavior is expected or not?

(I will share more details in internal Slack later.)

subjects:
- kind: ServiceAccount
name: {{ include "scalar-manager.headlampServiceAccountName" . }}
namespace: {{ include "scalar-manager.headlampServiceAccountNamespace" . }}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To keep the consistency in this chart, could you please add apiGroup: "" for now?
If we omit apiGroup: "" here, I think we should apply the same thing in other places in this chart.

namespace: {{ include "scalar-manager.headlampServiceAccountNamespace" . }}
roleRef:
kind: ClusterRole
name: cluster-admin
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Regarding this point, I have three questions:

1. The number of Service Accounts used for access to Headlamp

Please let me confirm the design of the access pattern for Headlamp through Scalar Manager from the user role perspective.

Which of the following is the designed behavior in Scalar Manager?

  • Pattern 1 (Share one service account in all Scalar Manager users)

                                    +---[Scalar Manager]------------------+
                                    |                                     |
    [User A (ADMINISTRATOR)]---+    |                                     |
                               |    |                                     |
    [User B (WRITER)]----------+--->+---[Headlamp Integration Feature]--->+---(Share one SA with `cluster-admin`)--->[Headlamp]---(Monitor Kubernetes Resources)--->[Kubernetes]
                               |    |                                     |
    [User C (READER)]----------+    |                                     |
                                    |                                     |
                                    +-------------------------------------+
    
  • Pattern 2 (Generate dedicated service account for each Scalar Manager user)

                                    +---[Scalar Manager]------------------+
                                    |                                     |
    [User A (ADMINISTRATOR)]------->+---[Headlamp Integration Feature]--->+---(Dedicated SA `user-a` with `cluster-admin`)---+
                                    |                                     |                                                  |
    [User B (WRITER)]-------------->+---[Headlamp Integration Feature]--->+---(Dedicated SA `user-b` with `edit`)------------+--->[Headlamp]---(Monitor Kubernetes Resources)--->[Kubernetes]
                                    |                                     |                                                  |
    [User C (READER)]-------------->+---[Headlamp Integration Feature]--->+---(Dedicated SA `user-c` with `view`)------------+
                                    |                                     |
                                    +-------------------------------------+
    
  • Pattern 3 (Generate shared service account for each Scalar Manager role)

                                    +---[Scalar Manager]------------------+
                                    |                                     |
    [User A (ADMINISTRATOR)]------->+---[Headlamp Integration Feature]--->+---(Shared SA `scalar-manager-admin` with `cluster-admin`)----+
                                    |                                     |                                                              |
    [User B (WRITER)]-------------->+---[Headlamp Integration Feature]--->+---(Shared SA `scalar-manager-writer` with `edit`)------------+
                                    |                                     |                                                              |
    [User C (WRITER)]-------------->+---[Headlamp Integration Feature]--->+---(Shared SA `scalar-manager-writer` with `edit`)------------+--->[Headlamp]---(Monitor Kubernetes Resources)--->[Kubernetes]
                                    |                                     |                                                              |
    [User D (READER)]-------------->+---[Headlamp Integration Feature]--->+---(Shared SA `scalar-manager-reader` with `view`)------------+
                                    |                                     |                                                              |
    [User E (READER)]-------------->+---[Headlamp Integration Feature]--->+---(Shared SA `scalar-manager-reader` with `view`)------------+
                                    |                                     |
                                    +-------------------------------------+
    

2. The default role for access to Headlamp

It seems that the service account for Headlamp has the cluster-admin role. However, I think it's too strong as a default value.

Especially, if the designed access pattern in Q1 is Pattern 1 (Share one service account in all Scalar Manager users), normal users, even though READER, have full access, including any update operations of the Kubernetes cluster through Headlamp.

I think it's not good from the perspective of the principle of least privilege. It seems that similar discussions exist on the Headlamp side as follows:

Therefore, I think it would be better to:

  1. Set the view role as a default, and make it configurable in the values.yaml file.
    • I think we should also discuss whether a configurable role is really necessary or not.
  2. Or, define fine-grained custom roles for Scalar Manager users based on Scalar Manager roles, ADMINISTRATOR, WRITER, and READER.

Also, users can use the generated token on the Scalar Manager page to access the Kubernetes cluster through other tools like the kubectl command. Therefore, we need to treat the generated token very carefully. Sorry, I overlooked this point when I talked about the rough design before, but I think we should reconsider this point again.

3. The purpose of Headlamp integration in Scalar Manager

This is related to the 2. The default role for access to Headlamp, but I'd like to confirm the purpose of the Headlamp integration.

I think Scalar Manager is almost a monitoring tool, for now. And, I think we decided to integrate Headlamp as an alternative to the CPU or Memory panel at the top page of Scalar Manager that existed in the prior implementation. In such a case, I think it's enough to provide integration with Headlamp only with read operations. In other words, I think we don't need to provide the way to create, update, and delete operations for Kubernetes resources through Scalar Manager.

I'd like to clarify the goal of the Headlamp integration and consider what role we need carefully. What is the purpose of this Headlamp integration?

name: {{ include "scalar-manager.fullname" . }}-headlamp-cluster-admin
labels:
{{- include "scalar-manager.labels" . | nindent 4 }}
app.kubernetes.io/component: headlamp
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a question. What is the purpose of this label? When and where do we use this label?
Please let me confirm the purpose of this label, since I couldn't find a clear reason to set this label here from this PR.

Comment on lines +200 to +207
# -- Kubernetes service discovery configuration (used by API)
kubernetes:
# -- Label name to identify Headlamp service
serviceLabelName: "app.kubernetes.io/name"
# -- Label value to identify Headlamp service
serviceLabelValue: "headlamp"
# -- Port name of the Headlamp service
servicePortName: "http"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have two questions about the Headlamp discovery:

1. In case of multiple Headlamp deployments

I think we assume that the Headlamp deployment is only one per Kubernetes cluster, but I think there is a possibility that multiple Headlamp deployments exist in one Kubernetes cluster.

What will happen in the Scalar Manager's Headlamp discovery feature if there are two or more deployments of Headlamp in one Kubernetes cluster?

2. Method of Headlamp detection

It's a bit related to Q1, but I think it might be better to set the Headlamp information explicitly instead of the dynamic discovery based on the labels, because we assume that we use only one Headlamp deployment.

If we can detect the Headlamp deployment without any configurations like label name and label value, it is worth providing such a feature because customers don't need to care about the Headlamp-related configurations.

However, users need to set the label name and label value in the current implementations. In such a case, I think it might be better to set a more explicit configuration, for example, namespace and service name, instead of dynamic detection.

In such implementations, I think we can also avoid unexpected issues when multiple Headlamp deployments exist in one Kubernetes cluster.

What do you think?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants