Hi all, from the CKA course, I learned a kubectl command `kubectl explain pod - . . .

Hi all,

from the CKA course, I learned a kubectl command kubectl explain pod --recursive

This command is best for understanding how to write a working k8s yaml file. However, I am confused about how to read it. For example,

# kubectl explain pod --recursive 
KIND:     Pod

     Pod is a collection of containers that can run on a host. This resource is
     created by clients and scheduled onto hosts.

   apiVersion	<string>
   kind	<string>
   metadata	<Object>
      annotations	<map[string]string>
      clusterName	<string>
      creationTimestamp	<string>
      deletionGracePeriodSeconds	<integer>
      deletionTimestamp	<string>
      finalizers	<[]string>
      generateName	<string>
      generation	<integer>
      initializers	<Object>
         pending	<[]Object>
            name	<string>
         result	<Object>
            apiVersion	<string>
            code	<integer>
            details	<Object>

Let’s look at initializers.pending specifically. Does it mean that we can use array [] or Object for its value?

Hinodeya learn:
It means that pending is the children of initializers object and he accepts list and array :wink:

@Hinodeya learn thanks for your reply.

Could you please explain the meaning of pending <[]Object> ?

Is it a object and it accepts array format? Am I right?

Hinodeya learn:
@Spark1231 yes totally right like a containers object accept name: images volume etc

Hinodeya learn:
kubectl explain pod --recursive | grep containers -A20

Hinodeya learn:
Normally the container object never take any value that is the principal meanning also and I think it’s your part of interrogation :wink:

Hinodeya learn:

Hinodeya learn:

Hinodeya learn:
images: …

Hinodeya learn:
So for summary the object doesn’t take any value but the children take it in this context of container []Object

Hinodeya learn:
I hope it’s more clear for you have a nice day dude

a litter bit clear now~ thank you