Open unicman opened 4 months ago
I'm encountering the same bug. It can be reproduced when a nonexistent namespace or one that for which my user doesn't have credentials is used.
I would suggest adding a new check at startup, in the InitConnection
function, and reuse the CanI
function to make sure we can at least get pods.
https://github.com/derailed/k9s/blob/626bde11f31e08cf8081bced7d911f6d121582fc/internal/client/client.go#L147
if that's not possible, we should fallback to showing the context switch panel when starting the app
what's your take on this @derailed ? if it seems like a valid check, I will submit a PR
Describe the bug k9s relies on access to selfsubjectaccessreviews and access to all namespaces. Requesting to remove that requirement please so that cluster with only specific namespace can be visualized in k9s tool.
It is possible to connect to kubernetes cluster using kubectl properly. kubectl get pods / kubectl get jobs command give successful response.
However trying to connect using k9s keeps giving error:
K9s logs indicate error in accessing selfsubjectaccessreviews and all namespace list ... our admin can't provide access to these for security reasons.
To Reproduce Steps to reproduce the behavior:
brew install kubernetes-cli
on Mac laptop.brew install k9s
on Mac laptop.~/.kube/config
is present.kubectl apply -f <sample.yaml>
. sample.yaml can be any standard pod / job deployment. Issue is not about it so it doesn't matter what you would use.kubectl get pods
. Ensure that pod(s) are visible in 'shmpri' namespace.k9s
. Expected behavior is text UI would open and allow k8s resources to be viewed. But it fails.k9s -n shmpri
. Expected behavior is text UI would open and allow k8s resources to be viewed. But it fails.Historical Documents N/A
Expected behavior k9s should allow traversing all pods and jobs etc in namespace 'shmpri'.
Screenshots Console output pasted above.
Versions (please complete the following information):
Version: v0.32.4 Commit: d3027c8f2916b23606f647f47b434b08fc34bdf8 Date: 2024-03-20T19:16:59Z
kubectl version
Client Version: v1.30.0 Kustomize Version: v5.0.4-0.20230601165947-6ce0bf390ce3 Server Version: v1.26.2