When working with Kubernetes via the command line, it's common to forget the exact structure of resources or their API versions. Fortunately, Kubernetes provides powerful CLI tools to explore resources and their fields โ€” without ever needing to leave the terminal.


๐Ÿ“˜ Exploring Kubernetes Resources with kubectl api-resources

To list all available resources in your cluster, use:

kubectl api-resources

This command is especially helpful when:

This output provides key details such as:


๐Ÿง  Understanding Resource Fields with kubectl explain

Once you've identified a resource, use the kubectl explain command to inspect its structure:

kubectl explain pods

This displays the top-level fields for the pods resource, such as: