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

Read namespace from kubeconfig when explicitly passing URL #425

Open
jacobtomlinson opened this issue Jul 1, 2024 · 0 comments
Open

Read namespace from kubeconfig when explicitly passing URL #425

jacobtomlinson opened this issue Jul 1, 2024 · 0 comments
Labels
bug Something isn't working good second issue Clearly described and reproducible, but solution less clear than "good first issue" help wanted Extra attention is needed

Comments

@jacobtomlinson
Copy link
Member

Which project are you reporting a bug for?

kr8s

What happened?

When we look up which Kubernetes server to connect to we use the following order:

  • URL explicitly passed to kr8s in Python
  • Server configured in kubeconfig
  • Server set by service account

In #360 we added support for loading the default namespace from the context set in the kubeconfig even if we are falling all the way back to using a service account credentials.

I noticed today that this is not the case when a URL is explicitly passed to kr8s. In this situation we always use the default namespace "default".

In #360 it was reasonable to add this because users may be inside a Pod that has a service account, but want to configure their default namespace. In this case a very minimal kubeconfig is created with just this information in.

In the case where a URL is being provided we are intentionally overriding the kubeconfig, so perhaps we don't want to try and look up the default namespace from that config. It's not clear if the current behaviour is expected. It would be good to see that kubectl does.

Anything else?

No response

@jacobtomlinson jacobtomlinson added the bug Something isn't working label Jul 1, 2024
@jacobtomlinson jacobtomlinson added the help wanted Extra attention is needed label Sep 9, 2024
@jacobtomlinson jacobtomlinson added the good second issue Clearly described and reproducible, but solution less clear than "good first issue" label Oct 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good second issue Clearly described and reproducible, but solution less clear than "good first issue" help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant