I’ve been leading the Krew “kubectl plugin manager” (a Kubernetes sub-project). Today, Krew is used to distribute over 70 kubectl plugins. This week, I finally took some time to write my first proper plugin.
Meet kubectl tree!
This plugin shows you which Kubernetes objects are owned by which ones.
It does this by querying all Kubernetes objects available, and looking at
For example, on a
Deployment object, it shows
ReplicaSets owned by the
Deployment, and the
Pods owned by those ReplicaSets (in this case,
deleting the Deployment would cause a cascading deletion of these sub-resources
for garbage collection):
The main purpose of the plugin is troubleshoot which objects are involved in
making a Kubernetes component work. For example, on a Knative Service (a.k.a.
KService), it shows underlying resources that make the app work:
Special shout-out to Nima Kaviani as his knative-inspect tool has inspired me to write a generic version of his tool that’s not limited to Knative ––or rather, I’ve been asking him to do this for a while. :)