derailed / k9s

🐶 Kubernetes CLI To Manage Your Clusters In Style!
https://k9scli.io
Apache License 2.0
27.53k stars 1.73k forks source link

Error viewing containers in pods on first load #2997

Open samcook opened 2 days ago

samcook commented 2 days ago




Describe the bug In the pods all view (not filtered to a specific namespace), when hitting enter on a pod to view its containers the list of containers fails to load (a blank view is displayed) and there is an error displayed at the bottom of the screen Watcher failed for containers -- pods "pod-name" not found.

Returning to the pods view and then pressing enter to go back to the containers view subsequently works as expected for any pods in the same namespace as the one that failed the first time.

Pods in other namespaces also show similar "Watcher failed" errors the first time before working on subsequent attempts.

The problem doesn't appear to happen when the pods view is set to show a specific namespace.

To Reproduce Steps to reproduce the behavior:

  1. Go to pods all view (not filtered by namespace)
  2. Press enter on a pod
    • Expect to see a list of containers in the pod, but instead get a blank container list view and Watcher failed for containers -- pods "pod-name" not found error
  3. Press escape to return to pod list
  4. Press enter on the same pod (or any other pod in the same namespace)
    • Container view now loads correctly
  5. Press escape to return to pod list
  6. Repeat steps 2-5 selecting pods in a different namespace

Historical Documents k9s -l debug log while starting k9s, going to pods all and then trying to view containers in pods in two different namespaces

11:42AM INF 🐶 K9s starting up...
11:42AM ERR Fail to locate metrics-server error="No metrics api group metrics.k8s.io found on cluster"
11:42AM DBG Active Context "arn:aws:eks:eu-central-1:111111111111:cluster/xyz"
11:42AM INF ✅ Kubernetes connectivity
11:42AM DBG No custom skin found. Using stock skin
11:42AM DBG Factory START with ns `"all"
11:42AM DBG Fetching latest k9s rev...
11:42AM DBG K9s latest rev: "v0.32.7"
11:42AM DBG No custom skin found. Using stock skin
11:42AM ERR Watcher failed for containers -- pods "arc-systems-gha-rs-controller-7c6ddb84c4-5rcwp" not found error="pods \"arc-systems-gha-rs-controller-7c6ddb84c4-5rcwp\" not found"
11:42AM ERR Watcher failed for containers -- pods "ingress-nginx-controller-6fcf745c45-55vt6" not found error="pods \"ingress-nginx-controller-6fcf745c45-55vt6\" not found"

Expected behavior Pressing enter on a pod in the pods all view should show the containers in the pod the first time.

Versions (please complete the following information):

Additional context Maybe the same issue as https://github.com/derailed/k9s/issues/1069?

derailed commented 7 hours ago

@samcook Thanks for the report! How many pods are present when viewing all namespaces?