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.
kubectl api-resourcesTo list all available resources in your cluster, use:
kubectl api-resources
This command is especially helpful when:
po for pods).v1 or V1?).This output provides key details such as:
kubectl explainOnce 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: