k9s
k9s copied to clipboard
Allow filtering for multiple namespaces at once

Is your feature request related to a problem? Please describe. I'd like to be able to look at multiple namespaces at the same time
Describe the solution you'd like
- :ns
- select multiple ns with ctrl+<space>
- <enter>
- see resources from multiple namespaces
Describe alternatives you've considered
Alternative way along the lines of https://github.com/derailed/k9s/issues/1292 :ns ns1,ns2
Additional context This would make it easier to look at issues across multiple namespaces. Switching between them is currently a bit of a pain.
Thanks for the great tool :)
Hello @landorg. Could you please show a couple of use cases here? Current k8s API doesn't support multiple ns, but we can simulate it making numerous requests.
Questions:
- What we should do if resources from 1 of 2 ns are not available to the current user?
Again: this is a huge enhancement and we should support this behavior for all resources but before I want to discuss all use cases and corner cases here :) Thanks!
Hi and thanks for the quick reply. I'm used to that from the rancher ui. That's why I'm missing it here.
The main use-case for me is to just look at multiple namespaces at once. Eg. Doing an update of multiple apps in different namespaces I usually look at the pods view and filter for all of these namespaces to watch the update & debug in case something goes wrong.
Another one would be debugging an issue where multiple namespaces are involved. Eg. some service can't be reached => I'm filtering for the namespace with the load-balancer and the one with the service.
Currently to mitigate this issue I'm not filtering for a Namespace and using the search with /ns1|ns2
(similar to what is said in #1681 ). But this shows me multiple false-positives.
Thanks :v:
This feature would be AMAZING! :)
I'm used to Lens, and just moving over to k9s. In Lens I quite often filter by multiple namespaces. Sometimes the work I'm doing revolves around a few different namespaces. I like to view all pods (or whatever object it is) across all those namespaces - without seeing all the system pods, or pods from namespaces I'm not interested in. This is one of the reasons at the moment, I quite often have to switch back to Lens for bits of work.
That could be nice something along the way kubectl get po -A | grep -P '^(ns1|ns2)'
+1 to this feature request
+1 and current use case.
Multiple namespaces to be managed by one team. looking for a Cronjob takes a few more clicks. would be nice to see them listed like ns:cronjob name
maybe something like a local alias namespace that combines two into one.
This idea came up today in a pairing session. I work on Consul and we deploy controllers and a management plane to the consul
namespace, but we often deploy applications that are part of the mesh in the default
or other namespaces. It would be wonderful to view the consul
+ default
namespaces when debugging.
There is somewhat of a workaround, but it definitely is a manual one.
For the resource you want to look at, e.g. Pods, switch to "all" namespaces.
Afterwards, start the search (hit /
) and search for parts of all namespaces you're interested in, joined by |
, e.g. default|kube-system
.
That said, I would very much prefer either a command line switch when calling k9s or an option when k9s is running.