<p>I currently have a Cronjob that has a job that schedule at some period of time and run in a pattern. I want to export the logs of each pod runs to a file in the path as <code>temp/logs/FILENAME</code>
with the <code>FILENAME</code> to be the timestamp of the run being created. How am I going to do that? Hopefully to provide a solution. If you would need to add a script, then please use python or shell command. Thank you.</p>

ddttdd
<p>According to <a href="https://kubernetes.io/docs/concepts/cluster-administration/logging/" rel="nofollow noreferrer">Kubernetes Logging Architecture</a>:</p>
<blockquote>
<p>In a cluster, logs should have a separate storage and lifecycle
independent of nodes, pods, or containers. This concept is called
cluster-level logging.</p>
<p>Cluster-level logging architectures require a separate backend to
store, analyze, and query logs. Kubernetes does not provide a native
storage solution for log data. Instead, there are many logging
solutions that integrate with Kubernetes.</p>
</blockquote>
<p>Which brings us to <a href="https://kubernetes.io/docs/concepts/cluster-administration/logging/#cluster-level-logging-architectures" rel="nofollow noreferrer">Cluster-level logging architectures</a>:</p>
<blockquote>
<p>While Kubernetes does not provide a native solution for cluster-level
logging, there are several common approaches you can consider. Here
are some options:</p>
<ul>
<li><p>Use a node-level logging agent that runs on every node.</p>
</li>
<li><p>Include a dedicated sidecar container for logging in an application pod.</p>
</li>
<li><p>Push logs directly to a backend from within an application.</p>
</li>
</ul>
</blockquote>
<p>Kubernetes does not provide log aggregation of its own. Therefore, you need a local agent to gather the data and send it to the central log management. See some options below:</p>
<ul>
<li><p><a href="https://github.com/fluent/fluentd#fluentd-open-source-log-collector" rel="nofollow noreferrer">Fluentd</a></p>
</li>
<li><p><a href="https://www.elastic.co/elastic-stack/" rel="nofollow noreferrer">ELK Stack</a></p>
</li>
</ul>
