<p>I currently have a kubernetes CronJob with a <code>concurrencyPolicy: Forbid</code>.
I would like to be able to uniquely identify this pod externally (k8 cluster) and internally from the pod, with an ID that will be unique forever.
I was thinking of using the <code>creationTimestamp</code> and the name of the pod but unfortunately it is <a href="https://stackoverflow.com/questions/72873334/how-to-pass-creation-timestamp-to-kubernetes-cronjob/72874894#72874894">not that easy to pass the <code>creationTimestamp</code></a>. Any other ideas?</p>

maxisme
<p>Just use the pod name like you had figured out from your other question:</p>
<pre><code>- name: POD_NAME
  valueFrom:
    fieldRef:
      fieldPath: metadata.name
</code></pre>
<p>The pod name should be very unique (if you want completely unique, you'll need to grab its UID, but i'm not sure what you're trying to solve).</p>
<p>The pod name will be generated using the following format:</p>
<pre><code>{{CRONJOB_NAME}}-{{UNIX_TIMESTAMP_IN_MINUTES}}-{{5_CHAR_RANDOM_ALPHANUM}}
</code></pre>
