<p>I'm looking to fully understand the jobs in kubernetes.</p>

<p>I have successfully create and executed a job, but I do not see the use case.</p>

<p>Not being able to rerun a job or not being able to actively listen to it completion makes me think it is a bit difficult to manage.</p>

<p>Anyone using them? Which is the use case?</p>

<p>Thank you.</p>

<p>A job retries pods until they complete, so that you can tolerate errors that cause pods to be deleted.</p>

<p>If you want to run a job repeatedly and periodically, you can use <a href="https://kubernetes.io/docs/concepts/workloads/controllers/cron-jobs/" rel="nofollow noreferrer">CronJob alpha</a> or <a href="http://blog.wercker.com/introducing-cronetes" rel="nofollow noreferrer">cronetes</a>.</p>

<p>Some Helm Charts use Jobs to run install, setup, or test commands on clusters, as part of installing services. (<a href="https://github.com/kubernetes/charts/blob/7b1b8e7ac3f49330d0a4c2df9a6c0e4d9d296c17/stable/spinnaker/templates/hooks/delete-jobs.yaml" rel="nofollow noreferrer">Example</a>).</p>

<p>If you save the YAML for the job then you can re-run it by deleting the old job an creating it again, or by editing the YAML to change the name (or use e.g. <code>sed</code> in a script). </p>

<p>You can watch a job's status with this command:</p>

<p><code>kubectl get jobs myjob -w</code></p>

<p>The <code>-w</code> option watches for changes. You are looking for the <code>SUCCESSFUL</code> column to show <code>1</code>.</p>

<p>Here is a shell command loop to wait for job completion (e.g. in a script):
<code>
until kubectl get jobs myjob -o jsonpath='{.status.conditions[?(@.type=="Complete")].status}' | grep True ; do sleep 1 ; done
</code></p>
