<p>How can I create, deploy and run and manage <a href="https://en.wikipedia.org/wiki/Cron" rel="nofollow noreferrer">Cron jobs</a> on Hasura?</p>

<p>Hasura suggests two ways to deploy and run Cron jobs.</p>

<h3>Cron microservice</h3>

<p>Hasura already has a microservice to run Cron jobs. </p>

<p>If you already have a Hasura project run:</p>

<pre><code>hasura microservice create mycron --template=python-cron
</code></pre>

<p>Change <code>mycron</code> to whatever you want to name your microservice. This will create a custom Python microservice designed to run Cron jobs. (Follow further instructions as prompted by <code>hasura</code> CLI)</p>

<p>To deploy this on Hasura, git commit and push to your cluster's remote.</p>

<pre><code>$ git add .
$ git commit -m "Add cron job"
$ git push hasura master
</code></pre>

<p>To know more about how to customize this microservice, you can read the <a href="https://hasura.io/hub/project/arvishankar/python-cron" rel="noreferrer">docs</a>.</p>

<h3>Kubernetes Cron jobs</h3>

<p>Since, Hasura runs on Kubernetes and Kubernetes (>= v1.8) already provides <a href="https://kubernetes.io/docs/concepts/workloads/controllers/cron-jobs/" rel="noreferrer">Cron Jobs</a> as a first class resource, it is recommended to use Kubernetes Cron jobs wherever possible.</p>

<p>If you have <code>kubectl</code> installed you can check your Kubernetes version by running: <code>kubectl version</code>. In the output, the "server version" shows the version of the Kubernetes cluster. If you are running Kubernetes >= v1.8, we recommend you to use Kubernetes Cron jobs.</p>

<p>When using Kubernetes Cron jobs, you can version control your cron job specs inside your Hasura project, and use the <code>kubectl</code> tool to create and manage them.</p>
