<p>I have ConfigMap, ImageStream, BuildConfig, DeploymentConfig APIs that successfully deploy my app and launch the number of pods as asked. But I want to use CronJob now.</p>
<p>Do I replace the DeploymentConfig completely? Because the idea is to launch a new pod according to a corn expression that is passed into the CronJob API.</p>

<p>Yes, why not 🤷, you can reuse the template 📓 section of your <code>DeploymentConfig</code>. For example:</p>
<pre class="lang-yaml prettyprint-override"><code>kind: &quot;DeploymentConfig&quot;
apiVersion: &quot;v1&quot;
metadata:
  name: &quot;frontend&quot;
spec:
  template: 
    metadata:
      labels:
        name: &quot;frontend&quot;
    spec:
      containers:
        - name: &quot;helloworld&quot;
          image: &quot;openshift/origin-ruby-sample&quot;
          ports:
            - containerPort: 8080
              protocol: &quot;TCP&quot;
  replicas: 5 
  triggers:
    - type: &quot;ConfigChange&quot; 
    - type: &quot;ImageChange&quot; 
      imageChangeParams:
        automatic: true
        containerNames:
          - &quot;helloworld&quot;
        from:
          kind: &quot;ImageStreamTag&quot;
          name: &quot;origin-ruby-sample:latest&quot;
  strategy: 
    type: &quot;Rolling&quot;
  paused: false 
  revisionHistoryLimit: 2 
  minReadySeconds: 0
</code></pre>
<p>would just become something like this 📃🏃:</p>
<pre class="lang-yaml prettyprint-override"><code>apiVersion: batch/v1beta1
kind: CronJob
metadata:
  name: frontend
spec:
  schedule: &quot;*/1 * * * *&quot;
  jobTemplate:
    spec:
      template:
        metadata:
          labels:
            name: &quot;frontend&quot;
        spec:
          containers:
            - name: &quot;helloworld&quot;
              image: &quot;openshift/origin-ruby-sample&quot;
              ports:
                - containerPort: 8080
                  protocol: &quot;TCP&quot;
          restartPolicy: OnFailure
</code></pre>
<p>✌️</p>
