<p>I have a cronjob object that creates a pod once every day. After processing some records in the pod I want the pod to store a timestamp that will be picked up the next day as input.</p>
<p>Therefore, I need some way to store some data from a pod that can be consumed later by another pod in the same cluster. I don't want to use the Persistent volumes for some reason. Therefore, is there any other approach for this.</p>
<p>I am considering using configMap for this. But I am not able to confirm if we can write or update data of a configMap from a pod.</p>
<p>After searching for it I found this <a href="https://github.com/kubernetes/kubernetes/issues/62099" rel="nofollow noreferrer">issue</a> that says configMaps are meant to be readonly at least till April, 2018 when this issue was created. I am wondering if any workaround has come since then.</p>

Rahul Satal
<p>You could use kubectl to modify an annotation of the <code>CronJob</code> object in case the value is safe to share as plane text. In this case just permission to kubectl annotate would be needed,</p>
<p>To write:</p>
<pre><code>kubectl annotate cronjob your-cronjob your-annotation='value'
</code></pre>
<p>To read:</p>
<pre><code>kubectl get cronjob your-cronjob -o jsonpath='{.metadata.annotations.your-annotation}'
</code></pre>
<p>Also, to avoid reading you could also pass the annotation value as an <code>ENV</code> variable:</p>
<pre><code>      env:
    - name: MYVARIABLE
      valueFrom:
        fieldRef:
          fieldPath: metadata.annotations.your-annotation
</code></pre>
