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

Load config file from KUBECONFIG env #33

Open
MyIgel opened this issue May 24, 2023 · 2 comments
Open

Load config file from KUBECONFIG env #33

MyIgel opened this issue May 24, 2023 · 2 comments

Comments

@MyIgel
Copy link

MyIgel commented May 24, 2023

It would be great it the client would try to load a config defined in the KUBECONFIG env var.
At the moment only $HOME/.kube/config is checked:

let kubeConfigURL = URL(fileURLWithPath: homePath + "/.kube/config")

@thomashorrobin
Copy link
Contributor

Hi @MyIgel, I think this would make sense. I actually wrote this bit of code and I can give you some guidance here if you want to do a PR.

I think you should just make a new struct that implements the protocol KubernetesClientConfigLoader and that way it'll fit in with all the others. I'm not sure modifying the existing behaviour is what you want to do. But you can check with @iabudiab

@iabudiab
Copy link
Member

iabudiab commented Jun 4, 2023

@MyIgel Yes, this is useful and should be easy to do

@thomashorrobin Exactly. I guess, the behaviour change is minimal and should be expected:

  • first $HOME/.kube/config
  • then KUBECONFIG env var
  • then /var/run/secrets/kubernetes.io/serviceaccount

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