Home > Net >  How can I `kubectl explain` the entire structure of a custom resource?
How can I `kubectl explain` the entire structure of a custom resource?

Time:02-03

I have a CR in the cluster. I know that there is a filed specialField somewhere in this CRD. I do not know where it is. Right now I am randomly exploring the CRD using kubectl explain path.to.some.filed to try to fiend the filed. Is there some way to explain the entire nested structure using kubectl explain?

What I am looking for is something like this

kubectl explain-magic my-crd

my-crd
 a
  b
   c
 other
  field 
 more
  fields
 very 
  nested
   field

or as an alternative

my-crd
a
a.b
a.b.c
other
other.field
more
more.fields
very
very.nested
very.nested.field

CodePudding user response:

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.

from kubectl help explain.

Just do: kubectl explain --recursive my-crd

  • Related