Skip to content

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

Open
@aman-sachdeva-osttra

Description

@aman-sachdeva-osttra

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    GKERelated to Google Kubernetes EnginebackendIssues related to the backendkind/bugCategorizes issue or PR as related to a bug.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions