<p>I am trying to create a cron job in openshift and having trouble doing this with oc so I am looking for alternatives. </p>

<p>I have already tried: "oc run cron --image={imagename} \ --dry-run=false"
This created another resource. There was no parameter to create a cron job</p>

<p>There's already a good answer on how the two platforms overlap. You mentioned there was no parameter to create a cronjob. You can do that with <code>oc</code> through the following <a href="https://docs.openshift.com/container-platform/3.5/dev_guide/cron_jobs.html" rel="nofollow noreferrer">(resource)</a>:</p>

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

<p>Or you can do it through a yaml file like the following:</p>

<pre><code>apiVersion: batch/v1beta1
kind: CronJob
metadata:
  name: hello
spec:
  schedule: "*/1 * * * *"
  jobTemplate:
    spec:
      template:
        spec:
          containers:
          - name: hello
            image: busybox
            args:
            - /bin/sh
            - -c
            - date; echo Hello from the Kubernetes cluster
          restartPolicy: OnFailure
</code></pre>

<p>And then run:</p>

<pre><code>oc create -f cronjob.yaml -n default
</code></pre>
