cronjobber
cronjobber copied to clipboard
Jobs fail to start with: cannot set blockOwnerDeletion
Hi, I am trying to run cronjobber in an Openshift v4.6 cluster; Kubernetes v1.19. I was able to deploy cronjobber via Helm chart provided in the repo but when I schedule a TZCronJob, I am getting this error when the job starts:
Warning FailedCreate 78s (x91 over 16m ) cronjobber Error creating job: jobs.batch "hello-1630089060" is forbidden: cannot set blockOwnerDeletion in this case because cannot find RESTMapping for APIVersion batch/v1beta1 Kind TZCronJob: no matches for kind "TZCronJob" in version "batch/v1beta1"
Here is the TZCronJob yaml I am using:
apiVersion: cronjobber.hidde.co/v1alpha1
kind: TZCronJob
metadata:
name: hello
spec:
schedule: "30 15 * * *"
timezone: "America/Sao_Paulo"
jobTemplate:
spec:
template:
spec:
containers:
- name: hello
image: busybox
args:
- /bin/sh
- -c
- date; echo "Hello, World!"
restartPolicy: OnFailure