<p>I want to execute data migration through Kubernetes cronjob using Luigi pipeline. My luigi task receives <code>--start</code> parameter which I want to pass through cronjob command.</p>
<pre><code>apiVersion: batch/v1beta1
kind: CronJob
metadata:
  name: migration
spec:
  schedule: &quot;0 0 */1 * *&quot;
  jobTemplate:
    spec:
      template:
        spec:
          serviceAccountName: spark
          containers:
          - name: migratecronjob
            image: latest-image
            imagePullPolicy: Always
            env:
              - name: TAG
                value: latest-image
              - name: MIGRATION_TAG
                value: migration-v05
            command:
              -  &quot;luigi&quot;
              - &quot;--module&quot; 
              - &quot;module.task&quot; 
              - &quot;Migrate10Days&quot;
              - &quot;--start&quot;
              - $(date +%Y-%m-%dT%H)
              - &quot;--workers&quot;
              - &quot;10&quot;
          restartPolicy: OnFailure
</code></pre>
<p>The cronjob cannot recognize the <code>$(date +%Y-%m-%dT%H)</code> as a bash script and pass this command as string to the luigi task.</p>

Pedro Martins
<p>I am not sure what are you going to archive, but this should work:</p>

<pre><code>      - command:
        - sh
        - -c
        - 'exec luigi --module module.task Migrate10Days --start $(date +%Y-%m-%dT%H) --workers --workers'
</code></pre>
