explain

Get the documentation of the resource and its fields

  1. kubectl explain pods

Get the documentation of a specific field of a resource

  1. kubectl explain pods.spec.containers

List the fields for supported resources.

This command describes the fields associated with each supported API resource. Fields are identified via a simple JSONPath identifier:

<type>.<fieldName>[.<fieldName>]

Add the —recursive flag to display all of the fields at once without descriptions. Information about each field is retrieved from the server in OpenAPI format.

Use “kubectl api-resources” for a complete list of supported resources.

Usage

$ kubectl explain RESOURCE

Flags

NameShorthandDefaultUsage
api-versionGet different explanations for particular API version (API group/version)
recursivefalsePrint the fields of fields (Currently only 1 level deep)