<p><a href="https://kubernetes.io/docs/tasks/job/automated-tasks-with-cron-jobs/" rel="nofollow noreferrer">Creating a Cron Job</a></p>
<p>What does the flag '-c' do in the Kubernetes Cronjob?</p>
<pre><code>kind: CronJob
metadata:
  name: hello
spec:
  schedule: &quot;* * * * *&quot;
  jobTemplate:
    spec:
      template:
        spec:
          containers:
          - name: hello
            image: busybox
            imagePullPolicy: IfNotPresent
            command:
            - /bin/sh
            - -c
            - date; echo Hello from the Kubernetes cluster
          restartPolicy: OnFailure
</code></pre>

panos
<p>Community wiki for clearness and further searches.</p>
<p>@François is completely correct. <a href="https://www.linux.org/docs/man1/bash.html" rel="nofollow noreferrer"><code>/bin/sh -c</code></a> comes directly from unix and simply means command you issue after shell. This is NOT a parameter for k8s cronjob :</p>
<blockquote>
<p>If  the  -c option is present, then commands are read from string.  If
there are arguments after the
string, they are assigned to the positional parameters, starting with $0.</p>
</blockquote>
<p>You can also check <a href="https://stackoverflow.com/questions/3985193/what-is-bin-sh-c">What is /bin/sh -c?</a></p>
