kubectl explain displays command-line documentation for a Kubernetes API object kind, including its description, API version, and available fields. Use it when creating manifests or checking an unfamiliar field instead of guessing its spelling or structure. section 4.2.2 section 4.4
Explore an object progressively:
- Start with kubectl explain <kind> to see the object description and top-level fields, such as apiVersion, kind, metadata, spec, and status. section 4.2.2
- Drill into nested fields with a path such as kubectl explain node.spec. section 4.2.2
- Specify --api-version when versions expose different fields or default values, and use --recursive to print the complete field hierarchy without descriptions. section 4.2.2
Finding a field selector
Before filtering events with kubectl get ev --field-selector type=Warning, run kubectl explain events to confirm that the type field accepts Normal or Warning. For a pod manifest, use kubectl explain pods to inspect available fields while adding container settings. section 4.3.1 section 5.2.1
