<p>I use Kubernetes which v1.19.7, when I run the CronJob sample</p>
<pre class="lang-yaml prettyprint-override"><code>apiVersion: batch/v1
kind: CronJob
metadata:
  name: express-learn-cronjob
spec:
  schedule: &quot;*/1 * * * *&quot;
  jobTemplate:
    spec:
      template:
        spec:
          containers:
            - name: hello
              image: busybox
              command:
                - /bin/sh
                - -c
                - date; echo Hello from the Kubernetes cluster
          restartPolicy: OnFailure
</code></pre>
<p>get  unable to recognize &quot;app-cronjob.yml&quot;: no matches for kind &quot;CronJob&quot; in version &quot;batch/v1&quot;</p>
<p>I can get the batch info by run kubectl api-versions | grep batch</p>
<pre class="lang-sh prettyprint-override"><code>batch/v1
batch/v1beta1
</code></pre>
<p>is there anything I missed? how can I fix it?</p>

seven
<p>For Kubernetes version 1.19.x you need to use <code>batch/v1beta1</code> as apiVersion for your CronJob.</p>
<p>That is documented in the doc version 1-19:</p>
<p><a href="https://v1-19.docs.kubernetes.io/docs/concepts/workloads/controllers/cron-jobs/" rel="noreferrer">https://v1-19.docs.kubernetes.io/docs/concepts/workloads/controllers/cron-jobs/</a></p>
<p>It is stable only on k8s version 1.21.</p>
