<p>I have a cronjob that is completing and outputting several log files.</p>

<p>I want to persist these files and be able access them after the pod has succeeded.</p>

<p>I've found I can access the stdout with <code>oc logs -f &lt;pod&gt;</code>, but I really need to access the log files.</p>

<p>I'm aware Openshift 2 apparently had an environment variable location OPENSHIFT_LOG_DIR that log files were written to, but Openshift 3.5 doesn't appear to have this.</p>

<p>What's my best way of logging and accessing the logs from the CronJob after the pod has succeeded and finished?</p>

<p>After a <code>Job</code> runs to completion, the <code>Pod</code> terminates, but it is not automatically deleted. Since it has completed, you need to use <code>-a</code> to see it. Once you have the <code>Pod</code> name, <code>kubectl logs</code> works as you would expect.</p>

<pre><code>$ kubectl get pods -a
NAME                                    READY     STATUS      RESTARTS   AGE
curator-1499817660-6rzmf                0/1       Completed   0          28d
$ kubectl logs curator-1499817660-6rzmf
2017-07-12 00:01:10,409 INFO ...
</code></pre>
