kubectl-tree
kubectl-tree copied to clipboard
Add label-selector to mitigate workload and data volume
This tool may not be applicable to large clusters as it lists all resources within the cluster. We can address this by filtering resources based on labels. It would alleviate the workload and reduce the transmitted data volume from the kube-api.
e.g:
$ kubectl tree hazelcast hz --selector='app.kubernetes.io/instance=hz'  ✔ │ 11:28:09 PM  
NAMESPACE NAME READY REASON STATUS AGE
default Hazelcast/hz - - 30s
default ├─Role/hz - - 30s
default ├─RoleBinding/hz - - 30s
default ├─Secret/hz - - 30s
default ├─Service/hz - - 30s
default │ └─EndpointSlice/hz-t7b2k - - 30s
default ├─ServiceAccount/hz - - 30s
default └─StatefulSet/hz - - 30s
default ├─ControllerRevision/hz-7855bcc97c - - 30s
default ├─Pod/hz-0 True Current 30s
default ├─Pod/hz-1 True Current 30s
default └─Pod/hz-2 True Current 30s