<p>I am trying to create a cronjob , I have written a Springboot application for this and have created a abc-dev.yml file for application configuration</p>
<p>error: unable to recognize &quot;src/java/k8s/abc-dev.yml&quot;: no matches for kind &quot;CronJob&quot; in version &quot;apps/v1&quot;</p>
<pre><code>apiVersion: apps/v1
kind: CronJob
metadata:
  name: abc-cron-job
spec:
  schedule: &quot;* * * * *&quot;
  jobTemplate:
    spec:
      template:
        spec:
          container:
          - name: abc-cron-job
            image: busybox
            imagePullPolicy: IfNotPresent
            command:
            - /bin/sh
            - -c
            - date; echo Hello from the Kubernetes cluster
          restartPolicy: OnFailure            
</code></pre>

<p>If you are running kubernetes 1.20 or lower, the correct apiVersion value is:</p>
<p><code>apiVersion: batch/v1beta1</code></p>
<p>If you are running kubernetes 1.21 or higher, its</p>
<p><code>apiVersion: batch/v1</code></p>
