ahmetb/kubectl-tree
ahmetb/kubectl-tree has 3,450 GitHub stars and 141 forks. GitHot measured 0 stars in 24 hours. Last checked 2026-11-06 18:33 UTC. Last push 2026-11-02.
kubectl plugin to browse Kubernetes object hierarchies as a tree 🎄 (star the repo if you are using)
Measured star growth
- in 24h
- 0
- in 7 days
- Collecting history
- in 15 days
- Collecting history
- in 1 month
- Collecting history
Net star changes over overlapping periods, not daily totals. Missing measurements are left blank. Stars measure attention, not software quality.
README.md
Originalkubectl tree
A kubectl plugin to explore ownership relationships between Kubernetes objects
through ownersReferences on the objects.
The kubectl lineage plugin is very similar to kubectl tree, but it
understands
logical relationships between some API objects without needing ownerReferences.
Installation
Use krew plugin manager to install:
kubectl krew install tree
kubectl tree --help
Demo
Example (Deployment):

Example (Knative Service):

Example (Agones Fleet):

Flags
By default, the plugin searches only namespaced objects in the same namespace as the specified object.
-A,--all-namespaces: Search namespaced and non-namespaced objects in all namespaces.-n,--namespace: Namespace scope for the CLI request.-c,--color: Control color output. Supported values arealways,never, andauto(default).-l,--selector: Selector (label query) to filter on. Supports equality (=,==,!=), set-based (in,notin), and existence operators. Examples:-l key1=value1,key2=value2(equality)-l "env in (prod,staging)"(set-based)-l "tier=frontend,env!=test"(mixed)
This helps reduce workload and data volume when working with large clusters.
--condition-types: Comma-separated list of condition types to check. Default:Ready. Example:Ready,Processed,Scheduled.--api-groups: Comma-separated list of API groups to include in the query. When not set, all API groups are included. Supports globs. Example:--api-groups=core,*cluster.x-k8s.io,!addons.*,*.cert-manager.io.--resources: Comma-separated list of resource types to include in the query. When not set, all resources are included. Supports globs. Example:--resources=deployments,rs,pods.Resource filters accept kind, singular, plural, and short names. For example,
ReplicaSets,replicasets,replicaset, andrsall match the same resource type.
Using --resources and --api-groups to define what APIs and resources are included or excluded while building the tree can significantly reduce workload and data usage in large clusters.
If an intermediate owner resource is filtered out, traversal stops at that point and child resources below it will be missing, even if the leaf resource or API would otherwise match.
For example, using --resources=deployments,pods will return nothing because replicasets are not included and pods are not directly owned by deployments.
kubectl tree --api-groups '*.custom.api,*cluster.x-k8s.io' --resources '!customresource' cluster my-cluster
Author
Ahmet Alp Balkan @ahmetb.
Special acknowledgement: This tool is heavily inspired by @nimakaviani's knative-inspect as it's a generalized version of it.
License
Apache 2.0. See LICENSE.
This is not an official Google project.
Explore related projects
codecrafters-io/build-your-own-x
Master programming by recreating your favorite technologies from scratch.
560,491 starspublic-apis/public-apis
A collective list of free APIs
496,796 starsmorluto/rea
Reverse engineer anything with agents, from app behavior down to native binaries.
438,576 starsopenclaw/openclaw
The AI that really does things. Any OS. Any Platform. The lobster way. 🦞
394,089 stars