headlamp-k8s / headlamp

A Kubernetes web UI that is fully-featured, user-friendly and extensible
https://headlamp.dev
Apache License 2.0
2.22k stars 156 forks source link

How to add multi-cluster to HeadLamp #1551

Closed umaatturu closed 3 months ago

umaatturu commented 11 months ago

"I'm currently using HeadLamp as my Kubernetes dashboard. I'm interested in adding support for multiple clusters to HeadLamp. Is it possible to achieve this, and if so, could someone please provide the integration steps?"

joaquimrocha commented 11 months ago

@umaatturu , are you using Headlamp in-cluster? If so, you may still be able to pass it a kubeconfig as a CLI option -kubeconfig. That kubeconfig should point to the server you which to display in your hosted Headlamp.

Granted, we normally don't test Headlamp in-cluster with multiple clusters, so if you encounter issues, please report them as I think this is an important feature.

umaatturu commented 11 months ago

@joaquimrocha, Thank you for your response. I noticed there's mention of an 'Add Cluster' option in the READ.md on GitHub. I've tried versions 0.21.0 and 0.20.0, but unfortunately, I couldn't find the 'Add Cluster' option in either version. Could someone provide guidance on how to enable this feature? Additionally, I believe it would be a valuable addition to HeadLamp if support for adding clusters could be integrated directly into the service.

I'm also curious about the compatibility of HeadLamp with cloud clusters such as EKS, AKS, and GKE. Does the HeadLamp Kubernetes dashboard support these cloud-based clusters?

headlamp

joaquimrocha commented 11 months ago

The add cluster feature is only available in the desktop mode, because we it would require some authentication system if we were to allow it in a shared environment (such as in-cluster or other web-deployments).

As for public clouds, yes! We have it in our plans to support logging in to them and selecting the clusters from them. This will also only be available in the desktop version for the same reasons.

When it comes to running Headlamp in a shared environment, Headlamp should be seen as a UI given to users by whoever deploys it, with a predefined list of clusters, etc., rather than an application that users will use from an "empty" state.

umaatturu commented 11 months ago

I've also attempted to access the desktop mode on a Linux OS using Tarballs commands, but I couldn't locate the option to add the cluster feature in the HeadLamp dashboard.

knrt10 commented 10 months ago

@umaatturu Hi. Can you please share the screenshot of the application you have configured? Thanks

umaatturu commented 10 months ago

I have configured the application using official HeadLamp document, you can check there https://www.headlamp.dev/docs/latest/installation/in-cluster/

knrt10 commented 10 months ago

Thank you for your response. As Joaquim explained earlier you would need a desktop application version of Headlamp. The link you are referring to will install Headlamp in a k8s cluster where the option is unavailable. If you are on Linux did you try the application on it? You can find the information on the website. https://www.headlamp.dev/docs/latest/installation/desktop/linux-installation/

umaatturu commented 10 months ago

We've experimented with the Linux mode, but we are encountering difficulties finding the option to add multiple clusters to the headlamp interface. Our specific need is to integrate and monitor several clusters within the headlamp tool.

knrt10 commented 10 months ago
Screenshot 2023-11-29 at 2 44 23 PM

I am attaching the screenshot from Mac device. You can either click on Load Cluster or Add cluster on the bottom left. To add multiple clusters you can add them to a single kubeconfig and Headlamp will read it. The app version is I am running is0.21.0. Is this the requirement that you need?

umaatturu commented 10 months ago

Thank you for your reply. In our Linux environment, we're facing challenges as we couldn't locate the 'add' option in the 0.21.0 version of Headlamp for integrating multiple clusters.

knrt10 commented 10 months ago

I am attaching the screenshot from my linux device. I downloaded the tarbal and ran the headlamp using ./headlamp command. As you can see it has Add cluster button on the bottom left.

Can you please share the screenshot for the app running? Thanks db1914fb-908f-4610-8db3-200877d948d1

illume commented 3 months ago

I guess this issue was too long ago to be useful now, so I'll close it.

However, @umaatturu if you have any further questions please feel free to comment here and we can try to help.

grzesuav commented 3 months ago

hi, I want to expose some in-cluster operations for developers, however we have multiple clusters. We would like to have single entrypoint - like headlamp UI - which can access multiple clusters.

Is there a way to declaratively configure it, similar like the i.e. argocd is discovering clusters by having secret with cluster RBAC credentials ?

joaquimrocha commented 3 months ago

@grzesuav , if you are deploying Headlamp to your users, you have 2 choices of setting up clusters. Either use the -kubeconfig CLI option to set a kubeconfig with multiple clusters. Or if you want to set up clusters dynamically from a config you have in the cluster, you can use what we call dynamic clusters. Hope this helps.