ketall icon indicating copy to clipboard operation
ketall copied to clipboard

Add separator between resource types

Open grzesuav opened this issue 5 years ago • 6 comments

Is your feature request related to a problem? Please describe. Currently we get one list for all resource types. Would be useful to have it grouped by resource type.

Currently

configmap/coredns                                                                        kube-system  27d    
configmap/extension-apiserver-authentication                                             kube-system  27d    
configmap/kube-proxy                                                                     kube-system  27d    
configmap/kubeadm-config                                                                 kube-system  27d    
configmap/kubelet-config-1.13                                                            kube-system  27d    
endpoints/kube-controller-manager                                                        kube-system  27d    
endpoints/kube-dns                                                                       kube-system  27d    
endpoints/kube-scheduler                                                                 kube-system  27d 

Describe the solution you'd like Proposal

configmaps:

configmap/coredns                                                                        kube-system  27d    
configmap/extension-apiserver-authentication                                             kube-system  27d    
configmap/kube-proxy                                                                     kube-system  27d    
configmap/kubeadm-config                                                                 kube-system  27d    
configmap/kubelet-config-1.13                                                            kube-system  27d 


endpoints:

endpoints/kube-controller-manager                                                        kube-system  27d    
endpoints/kube-dns                                                                       kube-system  27d    
endpoints/kube-scheduler                                                                 kube-system  27d 

Describe alternatives you've considered I was basing how k get all works. Additional context In case of namespace with a lot of resources - there is easier visually to look at results

grzesuav avatar Apr 11 '19 21:04 grzesuav

I do not insist on specific format, I would like something which clearly distinct different resource types

grzesuav avatar Apr 11 '19 21:04 grzesuav

@grzesuav The long-term plan is to output exactly the same as k get all. However, the resource printer code is not usable by plugins so far. There is an open issue in kubernetes which will solve this in the future. So expect a major improvement in that regard at some point.

However, until then I can improve the current printer. I'm a bit reluctant to add these headings, as this is also not the way how k get all does it. Would simply an empty line work for you? This would already separate resource groups visually.

corneliusweig avatar Apr 11 '19 21:04 corneliusweig

Yes, definitely will be better. Could you also link here upstream issue ? Thank you :)

grzesuav avatar Apr 12 '19 13:04 grzesuav

@grzesuav https://github.com/kubernetes/kubernetes/issues/74179

corneliusweig avatar Apr 12 '19 14:04 corneliusweig

@grzesuav After trying this out, I don't think that empty lines will improve the readability of the output. For example,

$ ketall -n tiller
NAME                     NAMESPACE  AGE
endpoints/tiller-deploy  tiller     17d  

pod/tiller-deploy-777d84c777-njlx9  tiller  17d  

secret/default-token-skk9k      tiller  17d  
secret/tiller-user-token-hbqdr  tiller  17d  

serviceaccount/default      tiller  17d  
serviceaccount/tiller-user  tiller  17d  

service/tiller-deploy  tiller  17d  

deployment.apps/tiller-deploy  tiller  17d  

replicaset.apps/tiller-deploy-777d84c777  tiller  17d  

deployment.extensions/tiller-deploy  tiller  17d  

replicaset.extensions/tiller-deploy-777d84c777  tiller  17d

Which looks quite odd and does not improve readability for me. This would not change, if the header were repeated for every group.

Besides, I think that no lines in between is more in line with kubectl, for example look at the output of k get all -oname. This also prints the full resource name and has no interspersed blank lines, just as ketall.

However, I'm considering to colorize the result. That might help a bit.

corneliusweig avatar Apr 14 '19 17:04 corneliusweig

Yes, but I was basing on just k get all - indeed, adding -oname looks awful. Hope coloring will help.

grzesuav avatar Apr 14 '19 20:04 grzesuav