Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Headlamp installation on GKE giving - error loading kubeconfig files: error reading kubeconfig file #3017

Open
aman-sachdeva-osttra opened this issue Mar 25, 2025 · 2 comments
Labels
backend Issues related to the backend bug Something isn't working GKE Related to Google Kubernetes Engine

Comments

@aman-sachdeva-osttra
Copy link

Describe the bug

While installing the headlamp into Google Kubernetes engine (GKE) with WIF enabled cluster we are getting the below error:-

{"level":"error","source":"/headlamp/backend/cmd/headlamp.go","line":419,"error":"error loading kubeconfig files: error reading kubeconfig file: open /home/headlamp/.config/Headlamp/kubeconfigs/config: no such file or directory","time":"2025-03-18T12:09:05Z","message":"loading dynamic kubeconfig"

To Reproduce

Steps to reproduce the bug:

  1. Create GKE cluster
  2. helm repo add headlamp https://headlamp-k8s.github.io/headlamp/
  3. helm install my-headlamp headlamp/headlamp
  4. Check the logs of the cluster and it will give you above error

Environment (please provide info about your environment):

  • Installation type: Linux
  • Headlamp Version: [0.29.0 , 0.22.0]

Are you able to fix this issue?

No

Additional Context

To over come the above issue we have tried:-
1) We had changed the headlamp Dockerfile to pick the kubeconfig.yaml file from the local and place it at '/home/headlamp/.config/Headlamp/kubeconfigs/config' with the headlamp as the user. Below are the changes made:-

RUN chown -R headlamp:headlamp /headlamp
COPY headlamp-kubeconfig.yaml /home/headlamp/.config/Headlamp/kubeconfigs/config
RUN chown headlamp:headlamp /home/headlamp/.config/Headlamp/kubeconfigs/config

USER headlamp

And updated the new docker image name in the depyloyment.yaml file of headlamp, the POD was getting the config file as shown below:-

Image

But with the above changes we were getting the same error:-

{"level":"error","source":"/headlamp/backend/cmd/headlamp.go","line":408,"error":"error loading kubeconfig files: error reading kubeconfig file: open : no such file or directory","time":"2025-03-24T11:05:04Z","message":"loading kubeconfig"}

2) We have tried with putting the kubeconfig.yaml into secrets and mounted that secrets into deployment.yaml (the mountPath was set as '/home/headlamp/.config/Headlamp/kubeconfigs/'), with passing the below env into values.yaml file which were attached to helm which doing helm install:-

env:

  • name: KUBECONFIG
    value: "/home/headlamp/.config/Headlamp/kubeconfigs/config"

With the above configuration as well we are getting the same error.

Kindly help what could be the issue here, and also while going through the platforms page on the site, its states that headlamp is not sure if works with GKE or not:-

https://headlamp.dev/docs/latest/platforms#tested-kubernetes-platforms

@aman-sachdeva-osttra aman-sachdeva-osttra added the bug Something isn't working label Mar 25, 2025
@dosubot dosubot bot added backend Issues related to the backend GKE Related to Google Kubernetes Engine labels Mar 25, 2025
@aman-sachdeva-osttra
Copy link
Author

Hi Team, any input on this will be highly appreciated.

@illume
Copy link
Collaborator

illume commented Mar 31, 2025

Hello.

Let me get back to you, I think we have some documentation on this, or some other people might have done something similar.

I think it looks in .kube/config so you could try copying it there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend Issues related to the backend bug Something isn't working GKE Related to Google Kubernetes Engine
Projects
Development

No branches or pull requests

2 participants