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

Support kubeconfig "merging" #147

Open
jinnovation opened this issue Feb 6, 2023 · 7 comments · May be fixed by #258
Open

Support kubeconfig "merging" #147

jinnovation opened this issue Feb 6, 2023 · 7 comments · May be fixed by #258

Comments

@jinnovation
Copy link
Owner

kubectl supports merging kubeconfigs via the KUBECONFIG env var. It would be valuable for Kele to support similar functionality, e.g. for users that like to maintain multiple discrete kubeconfigs that they alias/swap between.

@jinnovation
Copy link
Owner Author

This will require us to move to specifying KUBECONFIG every time we invoke kubectl instead of simply passing --kubeconfig since the latter does not support merging.

@jinnovation
Copy link
Owner Author

This will require us to move to specifying KUBECONFIG every time we invoke kubectl instead of simply passing --kubeconfig since the latter does not support merging.

This seems fine. The exact kubectl invocation is basically an implementation detail, so who really cares if it's ugly and sprawling? 🤠

@skrech
Copy link

skrech commented Sep 1, 2023

Just to note that currently having multiple files listed in KUBECONFIG envvar is causing errors on kele start-up, so I'm looking forward to this fix :)
Great effort @jinnovation !

@jinnovation
Copy link
Owner Author

Just to note that currently having multiple files listed in KUBECONFIG envvar is causing errors on kele start-up, so I'm looking forward to this fix :)

Thanks for this. Would you mind filing a separate issue as well w/ the error symptoms that you noticed? I think these two ("kele crashes with KUBECONFIG" and "kele actually supports KUBECONFIG properly") can be related-but-separate.

Great effort @jinnovation !

Thank you for playing around with my silly side project. 😇

@goncalvesnelson
Copy link

Hi, @jinnovation!
I think I am hitting this issue.
I get the following error:
Error caused by user's config or system: .doom.d/config.el, (error ‘/Users/nelson/.kube/config:/Users/nelson/.kube/config-teleport’ does not exist; set up kubectl properly and try again)
Let me know if you want me to provide you with any extra information. Thanks for the work you have put into creating this package!

@jinnovation
Copy link
Owner Author

I get the following error: Error caused by user's config or system: .doom.d/config.el, (error ‘/Users/nelson/.kube/config:/Users/nelson/.kube/config-teleport’ does not exist; set up kubectl properly and try again) Let me know if you want me to provide you with any extra information.

Definitely sounds related. I'm guessing that you set the KUBECONFIG environment variable?

Thanks for the work you have put into creating this package!

Thanks for using. 😇

@jinnovation
Copy link
Owner Author

jinnovation commented Feb 17, 2025

kubectl config view could be useful for easily retrieving the merged configs.

> KUBECONFIG="/Users/jjin/dev/jinnovation/kele.el/tests/kubeconfig.yaml:/Users/jjin/dev/jinnovation/kele.el/tests/testdata/kubeconfig.yaml" kubectl config view 

apiVersion: v1
clusters:
- cluster:
    server: https://111.111.111.111
  name: bar
- cluster:
    proxy-url: http://proxy.example.org:3128
    server: https://123.456.789.0:9999
  name: development-cluster
- cluster:
    certificate-authority-data: DATA+OMITTED
    server: https://127.0.0.1:59798
  name: kind-kele-test-cluster0
contexts:
- context:
    cluster: development-cluster
    namespace: development-namespace
    user: development-user
  name: development
- context:
    cluster: kind-kele-test-cluster0
    namespace: kube-system
    user: kind-kele-test-cluster0
  name: kind-kele-test-cluster0
- context:
    cluster: bar
    user: foo
  name: no-namespace
current-context: kind-kele-test-cluster0
kind: Config
preferences: {}
users:
- name: development-user
  user: {}
- name: kind-kele-test-cluster0
  user:
    client-certificate-data: DATA+OMITTED
    client-key-data: DATA+OMITTED

@jinnovation jinnovation linked a pull request Feb 17, 2025 that will close this issue
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

Successfully merging a pull request may close this issue.

3 participants