<p>Given a template for the cronjob, is there a possible way to verify that the metadata that I configured is as intended? For example, in the following template I use only the cronjob name which is cronj, what is the purpose then of the job and pods metadata and when do they get used?</p>
<pre><code>apiVersion: batch/v1beta1
kind: CronJob
metadata:
  name: cronj
spec:
  jobTemplate:
    metadata:
      name: cron-job
    spec:
      template:
        metadata:
          name: cron-pod
</code></pre>
<p>Also when doing scheduling, what is the difference between using <code>nodeName: controlplane</code> and <code>nodeSelector: kubernetes.io/hostname: master</code></p>

Silvia Wasur
<p>You can check out the documentation of cronjob in kuberenetes <a href="https://kubernetes.io/docs/concepts/workloads/controllers/cron-jobs/" rel="nofollow noreferrer">https://kubernetes.io/docs/concepts/workloads/controllers/cron-jobs/</a>. It states that a job creates one or more pods and that's why you need them. You can double check the container name in the pod description.</p>
<p>As for the difference between nodeName and nodeSelector, the main difference is that nodeName is a manual scheduler, while nodeSelector is scheduled using k8s scheduler. If you use nodeName then it will override the k8s scheduler.</p>
