Most Kubernetes objects can be created with kubectl create
, but if you need e.g. a DaemonSet
— you're out of luck.
On top of that, the objects being created through kubectl
can only be customized minimally (e.g. kubectl create deployment
allows you to only specify the image to run and nothing else).
So, considering that Kubernetes actually expects you to either edit a minimally configured object with kubectl edit
to suit your needs or write a spec from scratch and then use kubectl apply
to apply it, how does one figure out all possible keywords and their meanings to properly describe the object they need?
I expected to find something similar to Docker Compose file reference, but when looking at DaemonSet docs, I found only a single example spec that doesn't even explain most of it's keys.
The spec of the resources in .yaml
file that you can run kubectl apply -f
on is described in Kubernetes API reference.
Considering DeamonSet, its spec
is described here. It's template
is actually the same as in Pod resource.