Openshift Job exists, but doesn't get scheduled and can't be deleted

5/4/2021

I have an openshift project with several cron jobs. While a pod was down they kept running and now I see the error

Cannot determine if job needs to be started: Too many missed start time

which is a known issue. https://github.com/kubernetes/kubernetes/issues/42649

The only problem is when deleting the job this happens.

oc delete jobs occtool-cron-visitors
Error from server (NotFound): jobs.batch "occtool-cron-visitors" not found

But I also see this when trying to create it.

oc create -f occtool-deployment/14-cronjob-visitors.yaml
Error from server (AlreadyExists): error when creating "occtool-deployment/14-cronjob-visitors.yaml": cronjobs.batch "occtool-cron-visitors" already exists

A newer cronjob I created can do both of these without an issue

-- Brandon Kauffman
kubernetes
kubernetes-cronjob
openshift

1 Answer

5/4/2021

Jobs are artifacts of cronjobs. To delete the cronjob itself run:

oc delete cronjobs occtool-cron-visitors
-- Brandon Kauffman
Source: StackOverflow