ahmetb / kubectx

Faster way to switch between clusters and namespaces in kubectl
https://kubectx.dev
Apache License 2.0
17.66k stars 1.26k forks source link

Add --selector option to kubens #387

Open acouvreur opened 1 year ago

acouvreur commented 1 year ago

The list_namespace could have a new --selector option that would be beneficial to prefilter namespaces based on a known labels.

I believe this would improve load performance on high namespace volume and also help automating the pre-filtering.

ahmetb commented 1 year ago

This is not a bad idea but it largely doesn't address the root cause of the performance problem for large clusters (that is, selectors are executed after all namespaces are exhaustively retrieved from etcd).

A lot of the users alias this cmd to something like kns mostly because they want the simplicity, and this is a request I haven't received at all since the inception of the tool, which further makes me think it's not something people really need.

But I'll keep it open to see if there's more interest.