1

The jsonnet documentation > 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 and 2 and they don't really explain what is a "kubectl list object".

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

1 Answer 1

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.