<p>With App Engine GAE, we will usually have yaml with different cron tasks as follows:</p>
<pre><code>cron:
# Notifications Job
- description: &quot;Remove Notifications Cron Weekly run&quot;
  url: /tasks/notifications
  schedule: every monday 09:00
  timezone: Australia/NSW
# Jobs job
- description: &quot;Remove Deleted Jobs / completed&quot;
  url: /tasks/jobs/deleted_completed_drafts
  schedule: every monday 09:00
  timezone: Australia/NSW
# Marketplace job
- description: &quot;Remove Deleted Products / soldout&quot;
  url: /tasks/products/deleted_soldout_drafts
  schedule: every monday 09:00
  timezone: Australia/NSW
</code></pre>
<p>I moved to GKE, I can't figure out yet exactly how to run the above cron tasks from one file:</p>
<pre><code>apiVersion: batch/v1beta1
kind: CronJob
metadata:
  name: Cron Task
spec:
  schedule: &quot;*/1 0 0 * * 0&quot; #&quot;*/1 * * * *&quot;
  startingDeadlineSeconds: 104444
  concurrencyPolicy: Forbid
  successfulJobsHistoryLimit: 1
  failedJobsHistoryLimit: 1
  jobTemplate:
    spec:
      template:
        spec:
          containers:
          - name: callout
            image: gcr.io/my-site/mysite-kubernetes:v0.0.16
            args:
            - /bin/sh
            - -ec
            - curl https://www.ksite.com/tasks/notifications
          restartPolicy: Never
</code></pre>
<p>So how do I arrange the GKE Cron file to accommodate all the above tasks?
Do I have to write different(codes) for each different task?</p>
<p>The schedule should be every Monday 09:00 timezone: Australia/NSW. Is schedule: <strong>&quot;*/1 0 0 * * 0&quot;</strong> a correct representation of that?</p>
<p>Do I have to specify an image, cause the web-deployment script already has the image specified?</p>

<p><a href="https://kubernetes.io/docs/concepts/workloads/controllers/cron-jobs/" rel="nofollow noreferrer"><code>CronJob</code></a> in <strong>kubernetes</strong> uses standard <a href="https://en.wikipedia.org/wiki/Cron" rel="nofollow noreferrer">Cron</a> syntax:</p>
<pre><code># ┌───────────── minute (0 - 59)
# │ ┌───────────── hour (0 - 23)
# │ │ ┌───────────── day of the month (1 - 31)
# │ │ │ ┌───────────── month (1 - 12)
# │ │ │ │ ┌───────────── day of the week (0 - 6) (Sunday to Saturday;
# │ │ │ │ │                                   7 is also Sunday on some systems)
# │ │ │ │ │
# │ │ │ │ │
# * * * * * &lt;command to execute&gt;
</code></pre>
<p>So if you want to run your job <em>every Monday at 09:00</em> it should look as follows:</p>
<pre><code> ┌───────────── minute (0 - 59)
 │ ┌───────────── hour (0 - 23)
 │ │ ┌───────────── day of the month (1 - 31)
 │ │ │ ┌───────────── month (1 - 12)
 │ │ │ │ ┌───────────── day of the week (0 - 6) (Sunday to Saturday;
 │ │ │ │ │                                   7 is also Sunday on some systems)
 │ │ │ │ │
 │ │ │ │ │
 0 9 * * 1 &lt;command to execute&gt;
</code></pre>
<p>If your script was integrated with the image, you wouldn't need to use curl to execute it. Even if it's not part of the image but it is available locally on your node, you can think about mounting it as a <a href="https://kubernetes.io/docs/concepts/storage/volumes/" rel="nofollow noreferrer">Volume</a> e.g. <a href="https://kubernetes.io/docs/concepts/storage/volumes/#hostpath" rel="nofollow noreferrer">hostPath</a>, which is the simplest way of mounting a file located on your kubernetes node so it becomes available to your pods. In such case you simply need to put as your command the full path to the script:</p>
<pre><code>args:
- /bin/sh
- -c
- /full/path/to/script.sh
</code></pre>
<p>Otherwise you can use any image containing <strong>curl</strong> as <a href="https://stackoverflow.com/users/4945535/user140547">user140547</a> already suggeasted.</p>
<p>As to:</p>
<blockquote>
<p>It is probably better to write three Cronjobs than to try to cram all
three calls into one.</p>
</blockquote>
<p>I would also strongly recommend you to use 3 separate <code>CronJobs</code> as such approach is much simpler and easier to troubleshoot if anything goes wrong with running any of those jobs.</p>
