k9s: Access denied after context switch

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.
ERR Watcher failed for v1/pods error="[list watch] access denied on resource \"\":\"v1/pods\""
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:
- Go to K9s
- Switch context
- See error in log
Expected behavior The resources are shown correctly after context switch.
Versions (please complete the following information):
- OS: Windows
- K9s: 0.25.7
- K8s: 1.20.5
Additional context This does not happen if I switch to Kind and back. Only if I switch contexts of external Clusters.
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 19 (4 by maintainers)
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’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
k9s -l debug
will result in the error message and the Usage text (which i’ve trimmed down below):The error initially occurred while using the previous version. I first updated to v0.27.3 then uninstalled and re-installed without success.
I meet the same issue.
I see this in two ways
we can try to
kubectl get pods -n xxx
, confirm xxx can access and usek9s -n xxx
to Specify namespce@egvimo Let’s see if it’s still happening on v0.25.10. If not please reopen. Tx!