Skip to main content
Use kubectl explain to inspect Kubernetes resource types and their fields directly from the terminal. This is especially useful when you don’t know a resource’s full name, its short name, or the exact API version. kubectl explain reads the API schema (OpenAPI) exposed by your cluster, so the output reflects what your API server supports.
A presentation slide with the text "kubectl explain" on the left. On the right is a dark blue curved background featuring a white icon of a code window with a share/branch symbol.
Overview
  • Discover available resources with kubectl api-resources.
  • Use the NAME or SHORTNAMES from that list when running kubectl explain.
  • Inspect top-level fields (spec, status, metadata) or drill into nested fields using dot notation.
  • Use --recursive to list all nested fields.
Find resources available on your cluster
Example output:
Quick reference Using kubectl explain
  1. Inspect top-level fields (types and short descriptions)
Example output (truncated):
  1. Drill into a specific field with dot notation
Example output (truncated):
  1. Show all nested fields with --recursive
Example output (truncated):
Tip: kubectl explain reads the OpenAPI schema served by the API server, so it reflects the API groups and fields supported by your cluster. If a field is missing or differs from online docs, check the API group and version returned by kubectl api-resources and confirm your cluster version.
Warning: kubectl explain shows what the API server exposes. If your user account lacks permissions to read certain API groups, or if a CRD does not publish OpenAPI schema, those resources or fields may not appear in kubectl explain.
Links and references

Watch Video

Practice Lab