<p>I am trying to deploy my first cron job.</p>
<p>Starting with a very simple one, as described in the k8s <a href="https://kubernetes.io/docs/tasks/job/automated-tasks-with-cron-jobs/" rel="nofollow noreferrer">tutorial</a>:</p>
<pre><code>apiVersion: batch/v1
kind: CronJob
metadata:
  name: hello
spec:
  schedule: &quot;*/1 * * * *&quot;
  jobTemplate:
    spec:
      template:
        spec:
          containers:
          - name: hello
            image: busybox
            imagePullPolicy: IfNotPresent
            command:
            - /bin/sh
            - -c
            - date; echo Hello from the Kubernetes cluster
          restartPolicy: OnFailure
</code></pre>
<p>I am connected to my EKS cluster. This is the command and output:</p>
<pre><code>➜  Dev kubectl apply -f cronjob.yaml                                         
error: unable to recognize &quot;cronjob.yaml&quot;: no matches for kind &quot;CronJob&quot; in version &quot;batch/v1&quot; 
</code></pre>
<p>And batch/v1 does exists in my apiVersion list.</p>
<p>Can't understand what is wrong..</p>

jrz
<p>The Cronjob apiVersion in the kubernetes 1.18 is <code>batch/v1beta1</code></p>
<pre><code>apiVersion: batch/v1beta1
kind: CronJob
metadata:
  name: hello
spec:
  schedule: &quot;*/1 * * * *&quot;
  jobTemplate:
    spec:
      template:
        spec:
          containers:
          - name: hello
            image: busybox
            args:
            - /bin/sh
            - -c
            - date; echo Hello from the Kubernetes cluster
</code></pre>
<p><a href="https://v1-18.docs.kubernetes.io/docs/tasks/job/automated-tasks-with-cron-jobs/#creating-a-cron-job" rel="nofollow noreferrer">Source</a></p>
