How can I see a list of currently dormant cronjobs that have not yet ran?

7/21/2017

After triggering the following from my terminal, I have been unable to find a way to list Cronjobs running, but dormant and prior to their first run:

oc run pi --image=perl --schedule='*/1 * * * *' \
    --restart=OnFailure --labels parent="cronjobpi" \
    --command -- perl -Mbignum=bpi -wle 'print bpi(2000)'

https://docs.openshift.com/container-platform/3.5/dev_guide/cron_jobs.html

For cronjobs that are once a month, I would like to see them. I was expecting something like:

oc get cronjobs

But have found nothing like this. Is there anything I can do to list jobs either through the CLI or web interface to list cronjobs specifically?

-- James
cron
kubernetes
minishift
openshift

1 Answer

7/21/2017

In OpenShift 3.6, I have no issues with running:

$ oc get cronjobs
NAME      SCHEDULE       SUSPEND   ACTIVE    LAST-SCHEDULE
hello     */2 * * * *    False     0         Fri, 21 Jul 2017 14:02:00 +1000

When the cronjob time arrives a job is created from the job template.

$ oc get jobs
NAME               DESIRED   SUCCESSFUL   AGE
hello-1500609360   1         1            38m
hello-1500609420   1         1            37m
hello-1500609600   1         1            34m
hello-1500609660   1         1            32m

Don't know why at this point, but oc describe cronjob doesn't work in 3.6-rc.0 though. Have already asked why that is.

-- Graham Dumpleton
Source: StackOverflow