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

Error: unable to load kubeconfig: error loading config file "/home/.kube/config": open /home/.kube/config: permission denied #251

Open
srisurya777 opened this issue Apr 9, 2023 · 8 comments

Comments

@srisurya777
Copy link

Ubuntu 20.04
kubelogin version
git hash: v0.0.28/2026869c86368dafa3ff06001b68f9a881dee75c
Go version: go1.20.2
Build time: 2023-03-14T19:17:37Z
Platform: linux/amd64

An easy login converted to something thats so complex. Behaves different in different OS for same credentials. Here is the issue on ubuntu 20.04. The user can read the file but the kubelogin convert command cannot. No matter how the permissions are changed it keeps throwing the same error not telling what to do. can someone please help quickly.

@bcho
Copy link
Member

bcho commented Apr 9, 2023

Can you share the full command used? By default, kubelogin converts the kubeconfig from path $HOME/.kube/config . But from your error message, seems like the $HOME environment variable resolved to something else. Could you please share the output of echo $HOME from the shell you run the convert command?

@srisurya777
Copy link
Author

I actually removed out the /home/username for some reasons. I explicitly export KUBECONFIG to the one that I want it to use. The error also shows the right path where it has to read from. However it fails for permissions.

@srisurya777
Copy link
Author

Here is the output

firstwatch@fpsp-eastus2-prod-firstwatch-infr-vm-1:$ export KUBECONFIG=/.kube/config
firstwatch@fpsp-eastus2-prod-firstwatch-infr-vm-1:$ kubelogin convert-kubeconfig -l azurecli
Error: unable to load kubeconfig: error loading config file "/home/firstwatch/.kube/config": open /home/firstwatch/.kube/config: permission denied
firstwatch@fpsp-eastus2-prod-firstwatch-infr-vm-1:
$

@bcho
Copy link
Member

bcho commented Apr 10, 2023

Do you expect to convert the config in path /.kube/config ? The error message seems it's not using that path at all. Can you try following command and provide the output:

$ kubelogin convert-kubeconfig -l azurecli --kubeconfig /.kube/config

@weinong
Copy link
Contributor

weinong commented Apr 10, 2023

Did you install it via snap? snap installation is broken. #231 (comment)

@srisurya777
Copy link
Author

@weinong thank you. Thats what I assumed but the documentation to install without snap is not clear. The github issue you pointed doesnt have any solution, too. Let me investigate more or please send if you have something

@srisurya777
Copy link
Author

please post if anyone has installed on ubuntu without snap

@weinong
Copy link
Contributor

weinong commented Apr 21, 2023

@srisurya777 are you able to use az aks install-cli or simply grab from the release artifact?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants