<p><a href="https://i.stack.imgur.com/iTlc3.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/iTlc3.png" alt="enter image description here"></a></p>

<p>What does the field mean?</p>

<p>Besides, if I will use it, what conditions my configuration need to meet?</p>

zhangqichuan
<p>Template field determines how a pod will be created. In this field you specify <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#metadata" rel="nofollow noreferrer">metadata</a> and <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#spec-and-status" rel="nofollow noreferrer">spec</a> values. Pod Template is used in workloads such as <code>DaemonSets, Deployments, Jobs</code>. Based on this template it creates a pod to match desired state. </p>

<p><code>Metadata</code> field in <code>template</code> section is mostly used to specify labels that will be assigned to each pod created by the controller (Deployment, DaemonSet etc.) and is used for identification. Whenever you specify those labels, you have to also specify  <code>selector</code> that matches pod template's labels.</p>

<p><a href="https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.16/#podspec-v1-core" rel="nofollow noreferrer">Spec</a> field is a specification of the desired behavior of the pod- configuration settings that will be used by a pod. Every replica of the pod will match this configuration.</p>

<p>Each workload controller react different to changes in pod template. For example, deployment will first create a new pod to match current template and then delete pod that doesn't match the template. </p>
