<p>when I run the cronjob into Kubernetes, that time cron gives me to success the cron but not getting the desired result</p>
<pre><code>apiVersion: batch/v1beta1
kind: CronJob
metadata:
  name: {{ $.Values.appName }}
  namespace: {{ $.Values.appName }}
spec:
  schedule: &quot;* * * * *&quot;
  concurrencyPolicy: Forbid
  jobTemplate:
    spec:
      template:
        spec:
          containers:
            - name: test
              image: image
              command: [&quot;/bin/bash&quot;] 
              args: [ &quot;test.sh&quot; ]
          restartPolicy: OnFailure
</code></pre>
<p>also, I am sharing test.sh</p>
<pre><code>#!/bin/sh
rm -rf /tmp/*.*
echo &quot;remove done&quot;
</code></pre>
<p>cronjob running successfully but
when I checked the container the file is not getting deleted  into <strong>/tmp</strong> directory</p>

<p>You need to have the persistence volume attached with you pod and cronjob that you are using so it can remove all the files when the script get executed. You need to mount and provide path accordingly in your script. For adding kubernetes cronjobs kindly go through this <a href="https://stackoverflow.com/questions/46578331/kubernetes-is-it-possible-to-mount-volumes-to-a-container-running-as-a-cronjob">link</a></p>
