<p>I want to create a cronjob that interacts with my API.
First, I need to send a request to authentificate, then send a GET request</p>
<p>Here is the yaml of my cronjob:</p>
<pre><code>apiVersion: batch/v1beta1
kind: CronJob
metadata:
  name: verification-pointage
  namespace: isi-incubator
spec:
  schedule: &quot;*/1 * * * *&quot;
  jobTemplate:
    spec:
      template:
        spec:
          containers:
            - name: verification-pointage
              image: curlimages/curl:7.77.0
              imagePullPolicy: IfNotPresent
              command: [&quot;/bin/sh&quot;,&quot;-c&quot;]
              args: [&quot;curl -c session -H \&quot;Content-Type:application/json\&quot; -d '{\&quot;username\&quot;:\&quot;johndoe\&quot;,\&quot;password\&quot;:\&quot;johndoe123\&quot;}' http://odoo-api/authentication  &amp;&amp; curl -b session http://odoo-api/timesheets/verification&quot;]
          restartPolicy: OnFailure
</code></pre>
<p>When I do the two curl commands in local, I have no problem, but when the commands are executed in the cronjob, the <code>session</code> doesn't seem to have been created. So the second command cannot use the cookie stored in the session file.</p>

Couldosh
<p>Ok, so I change the path to the cookie file from <code>session</code> to <code>tmp/session</code> and it works</p>
