<p>The folowing answer comes from a <a href="https://kubernetes.slack.com/archives/C981W2HD3/p1697797708999419?thread_ts=1697796910.539769&amp;cid=C981W2HD3" rel="nofollow noreferrer" title="#kapitan on Kubernetes slack">conversation</a> on the Kubernetes #kapitan channel with @ademaria and <a href="https://kubernetes.slack.com/archives/C981W2HD3/p1697797708999419?thread_ts=1697796910.539769&amp;cid=C981W2HD3" rel="nofollow noreferrer" title="#kapitan on Kubernetes slack">Types(kinds)</a>.</p>
<p>&quot;kubectl list object&quot; is a kubectl client-only feature (see <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#types-kinds" rel="nofollow noreferrer" title="Types (Kinds)">1</a>):</p>
<blockquote>
<p>Note that kubectl and other tools sometimes output collections of resources as kind: List. Keep in mind that <strong>kind: List is not part of the Kubernetes API</strong>; it is exposing an implementation detail from <strong>client-side code</strong> in those tools, <strong>used to handle groups of mixed resources</strong>.</p>
</blockquote>
<p>you can write</p>
<pre><code>apiVersion: v1
kind: List
items:
- apiVersion: v1
  kind: Pod
  ...
- apiVersion: v1
  kind: ConfigMap
</code></pre>
<p>and you can <code>kubectl apply -f xxx.yaml</code> that and kubectl will at the client side convert that before applying it via the Kubernetes API (which does not have any <code>kind:List</code>,etc)</p>
<p>So the jsonnet documentation is refering to the fact that you can create a <code>v1/List</code> object (<strong>a single kubectl list object</strong>) with all the resources inside and pass that to kubectl, the same way you will pass a yaml stream.</p>
<p>It's list object or list resource but since it's only client-side they emphasize that by saying  its a <strong>kubectl list object</strong></p>

CC BY-SA 4.0
2023-10-20T12:30:06.843Z
2023-10-20T12:30:06.843Z
RubenLaguna
<p>The <a href="https://jsonnet.org/articles/kubernetes.html" rel="nofollow noreferrer" title="Using Jsonnet With Kubernetes">jsonnet documentation &gt; Using Jsonnet With Kubernetes</a> says:</p>
<blockquote>
<p>Use YAML stream output, multi-file output, or a <strong>single kubectl list object</strong>. This latter option is provided by Kubernetes without requiring any special support from Jsonnet. It allows us to <strong>group several Kubernetes objects into a single object</strong>. This is the most popular option because it does not require intermediate files, and other tools don't always reliably support YAML streams.</p>
</blockquote>
<p>YAML streams is putting several resources separated with <code>---</code> , multi-file output is self-explanatory, but I never heard of a &quot;kubectl list object&quot;.</p>
<p>If I google it I only get <a href="https://jsonnet.org/articles/kubernetes.html" rel="nofollow noreferrer" title="Using Jsonnet With Kubernetes">1</a> and <a href="https://sre.google/workbook/configuration-specifics/" rel="nofollow noreferrer" title="SRE &gt; Integrating the Configuration Language">2</a> and they don't really explain what is a &quot;kubectl list object&quot;.</p>
<p>So,  What is a <strong>single kubectl list object</strong> in this context?</p>

<kubernetes><kubectl>
What is a "single kubectl list object" as mentioned in jsonnet documentation?
RubenLaguna
# What is a "single kubectl list object" as mentioned in jsonnet documentation?

(Asked by: username_0 on 2023-10-20)

The [jsonnet documentation > Using Jsonnet With Kubernetes](https://jsonnet.org/articles/kubernetes.html "Using Jsonnet With Kubernetes") says:

> Use YAML stream output, multi-file output, or a **single kubectl list object**. This latter option is provided by Kubernetes without requiring any special support from Jsonnet. It allows us to **group several Kubernetes objects into a single object**. This is the most popular option because it does not require intermediate files, and other tools don't always reliably support YAML streams.

YAML streams is putting several resources separated with `---` , multi-file output is self-explanatory, but I never heard of a "kubectl list object".

If I google it I only get [1](https://jsonnet.org/articles/kubernetes.html "Using Jsonnet With Kubernetes") and [2](https://sre.google/workbook/configuration-specifics/ "SRE > Integrating the Configuration Language") and they don't really explain what is a "kubectl list object".

So, What is a **single kubectl list object** in this context?

**Tags:** kubernetes, kubectl


---

## 1 answers

### Answer by username_0 on 2023-10-20. Score: 1

The folowing answer comes from a conversation on the Kubernetes #kapitan channel with @ademaria and Types(kinds).
"kubectl list object" is a kubectl client-only feature (see 1):

Note that kubectl and other tools sometimes output collections of resources as kind: List. Keep in mind that kind: List is not part of the Kubernetes API; it is exposing an implementation detail from client-side code in those tools, used to handle groups of mixed resources.

you can write
apiVersion: v1
kind: List
items:
- apiVersion: v1
  kind: Pod
  ...
- apiVersion: v1
  kind: ConfigMap

and you can kubectl apply -f xxx.yaml that and kubectl will at the client side convert that before applying it via the Kubernetes API (which does not have any kind:List,etc)
So the jsonnet documentation is refering to the fact that you can create a v1/List object (a single kubectl list object) with all the resources inside and pass that to kubectl, the same way you will pass a yaml stream.
It's list object or list resource but since it's only client-side they emphasize that by saying  its a kubectl list object


---

