cronjobber icon indicating copy to clipboard operation
cronjobber copied to clipboard

Jobs fail to start with: cannot set blockOwnerDeletion

Open mauricio-usatai opened this issue 2 years ago • 0 comments

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

mauricio-usatai avatar Aug 27 '21 19:08 mauricio-usatai