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

Spark1231:
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
VERSION:  v1

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

FIELDS:
   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:

Spark1231:
@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:
Exemple:

Hinodeya learn:
containers:

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

Spark1231:
a litter bit clear now~ thank you