<p>I have the below yaml which is running fine in kubernetes but not working in Openshift with below error. Many more components yaml run seamlessly and this log path is created but only for this one it is not working.</p>
<p>Error:</p>
<pre><code>Warning  FailedPostStartHook  12m (x2 over 12m)  kubelet            Exec lifecycle hook ([/bin/sh -c echo &quot;`date +'%Y-%m-%d %H:%M:%S,%3N'` [main] [] INFO  [postStarthook] - Starting txe ...&quot;
&gt;&gt;/var/seamless/log/txe/txe.log]) for Container &quot;ers-txe&quot; in Pod &quot;ers-txe-547b59778f-2zpgm_ers(36a9bfc2-5817-4ed4-bbee-9923580d9fba)&quot; failed - error: command '/bin/sh -c echo &quot;`date +'%Y-%m-%d %H:%M:%S,%3N'` [main] [] INFO  [postStarthook] - Starting txe ...&quot;
&gt;&gt;/var/seamless/log/txe/txe.log' exited with 1: /bin/sh: can't create /var/seamless/log/txe/txe.log: Permission denied , message: &quot;/bin/sh: can't create /var/seamless/log/txe/txe.log: Permission denied\n&quot;   Normal   Killing            12m (x2 over 12m)  kubelet  FailedPostStartHook
</code></pre>
<p>Stackoverflow doesn't allow me to paste complete yaml so let me know what other information is required. My yaml contains
PV - for txe component
PVC - for txe component
PV - for mysql
PVC - for mysql
ClusterIP service
Deployment file</p>

Aman Singh
<p>You're probably running as root by default in kube, and as the high UID in OpenShift.</p>
<p>This error line is where I think the issue is:
&quot;/bin/sh: can't create /var/seamless/log/txe/txe.log: Permission denied\n&quot;</p>
<p>Check file permissions on that directory, check UID/GID that you're running as.</p>
<p>In OpenShift, you usually leverage the GID (not the UID) of the container runtime processes, so I would suggest a small rebuild of your container image to add &quot;chgrp group ... chmod g+w ...&quot; on the directories in question.</p>
<p>The other quick hack to fix this is, remembering that all of these directories are transient anyway, just change your command to write to /tmp instead.</p>
