Where can I find an official template which describes how to create your .yaml
file to setup services/pods in Kubernetes?
The template is a template for how to create those pods. If you want to use a deployment (where K8s automatically maintains a configured number of replicas of your pod) then you must have a template for creating the pods. Note that the spec part also belongs to the template.
The YAML Templating Tool (ytt) is a new take on YAML templating, and when we say templating what we really mean is data structure building. At its core, ytt is the idea that we can use YAML comments to annotate YAML structures (such as maps, arrays, and even documents) with necessary instructions and metadata.
template field of the YAML configuration. The Deployment object not only creates the pods but also ensures the correct number of pods is always running in the cluster, handles scalability, and takes care of updates to the pods on an ongoing basis.
You can find the specification for a pod here http://kubernetes.io/docs/api-reference/v1/definitions/#_v1_pod
A good starting point is also the examples https://github.com/kubernetes/kubernetes/tree/master/examples
Additional you can create the ressource via kubectl and export the resource to yaml
e.g. for a pod you can run this command:
kubectl run nginx --image=nginx
kubectl get pods ngnix -o yaml > pod.yaml
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With