add --sort?
ahmetb opened this issue · comments
This plugin is great! I use it daily, but sometimes I find myself doing kubectl view-allocations -g namespace -r cpu
to see which namespaces have the most allocations. But finding that right now is manual. I think it can be applied to other resources too.
(I actually tried to add this myself but sadly my Rust skills are non-existent.)
Hi,
I'm glad to know that the plugin is useful.
Can you give more details about the feature ?
For example, do you expect that --sort "column"
will sort in ,decreasing, on the column
("usage", "requested", "limit" in Qty (or in %)) and keep hierarchy, but sort between sibling only ?
Honestly not sure :) maybe --sort=-2 sorts the 2nd col descending, I don't know. Might complicate things quite a bit.
I came to open this issue again :D
I think I'm trying to figure out answers to something like: show me namespaces with most cpu allocations. e.g.
kubectl view-allocations -g namespace -r cpu --sort=-cpu
even this would go a long way. I think also, while scrolling down the list and examining results by eye, human-readable ints like 1.5k
aren't helping as they don't appear longer than 10.0
:)
I guess you have a typo in your sample
kubectl view-allocations -g namespace -r cpu --sort=-allocation
I'll see how to provide a first cli for this, but may be more sql like