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