-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Access denied after context switch #1345
Comments
Strange, I've tried reproducing, but context switching works fine for me on v.0.25.7. |
"Access denied" indicates that the user has no permission. Maybe the context switch does not switch the user correctly? I've tried the In another environment context switching works for me too. |
Here is a debug log with the switch. The first log starts with context 1 and switches to context 2. The second log the other way around. Context 1 -> Context 2
Context 2 -> Context 1
|
After looking closely at the log, I think I've found the problem:
The error indicates that K9s tries to get the pod list from the previous namespace |
Could this be the line 392 from here? Lines 387 to 396 in 9b49819
Here the current namespace is selected, but the new namespace should be used. |
@egvimo Thank you fo the details on this!! Can u give v0.25.8 a rinse and see if we're happier? Tx!! |
@derailed Still the same issue. The namespace specified in the context is ignored.
|
@egvimo Rats! Tx for reporting back!! Could you add more details here ie the full logs switch context ctx1->ctx2? I have an idea but it could be a shot in the dark as I can't seem to repro locally ;( |
You can find the full log here: #1345 (comment) The problem is, that the namespace of the previous context is used for the new context. My current workaround is to switch the context and then manually switch the namespace to the one specified in the kubeconfig file. |
@egvimo Let's see if it's still happening on v0.25.10. If not please reopen. Tx! |
@derailed The issue was gone in v0.25.10 and is back again in v0.25.12. Could you please reopen. |
Works with v0.25.18. Thanks |
I'm having this issue with v0.27.3. I'm on macos 12.6 with kubectl 1.25.2. I don't recall switching context to trigger the error though. Also, I'm not finding how to provide the verbose logging as others have. Attempting to execute
The error initially occurred while using the previous version. I first updated to v0.27.3 then uninstalled and re-installed without success. |
Fixed this issue by reboot my mac) |
thx @Doofus100500. I dunno if this was the root cause for me but after explicitly adding a namespace to my kubectl context I now am no longer having the issue.
|
I meet the same issue. I see this in two ways
we can try to |
@mathcoder23 thx. including any namespace gets me past the error. |
@ecarey-paa Please take a peek at your k9s config + kubeconfig. |
I was also getting the error:
when I try to start k9s with no namepace because, in my case, I lack permissions (
I can list namespaces ( I can work around this by deleting my
If I later try to issue a |
I have the same issue. Switching between contexts using k9s isn't working. My assumption is that it tries to list all namespaces and if it lacks permissions it fails. It should use namespaces defined in kubeconfig instead without listing all namespaces. |
@startio-dmitry-k I dunno if this has anything to do with the root cause for you but one thing different I'm doing now (and maybe you're already doing 🤷 ) is to set the KUBECONFIG env var. I recently learned that this env var is a list of colon separated configs. Adding that to my shell's run command file made context switching in k9s work. For example, I have 3 contexts and my KUBECONFIG looks like this now:
Without exporting that env var, executing a bare |
Describe the bug
If I start K9s everything works fine with the current context, but if I switch the context via K9s the view stays empty.
If I exit K9s switch context via
kubectl
and then enter K9s again. All resources are being displayed correctly.To Reproduce
Steps to reproduce the behavior:
Expected behavior
The resources are shown correctly after context switch.
Versions (please complete the following information):
Additional context
This does not happen if I switch to Kind and back. Only if I switch contexts of external Clusters.
The text was updated successfully, but these errors were encountered: