<p>in the docs there is an option of using <code>postStart</code> hook, however we have some long script that we want to run, how we can do it ? I mean to provide the script and provide the path to run it ... instead of running it inline ...</p>

<pre><code>apiVersion: v1
kind: Pod
metadata:
  name: lifecycle-demo
spec:
  containers:
  - name: lifecycle-demo-container
    image: nginx
    lifecycle:
      postStart:
        exec:
          command: ["/bin/sh", "-c", "echo Hello from the postStart handler &gt; /usr/share/message"]

</code></pre>

Jenny M
<p>You just need to mention the path of the script, refer this <a href="https://stackoverflow.com/questions/59521684/how-to-execute-a-sql-script-file-in-a-kubernetes-pod"><code>answer</code></a></p>

<pre><code>lifecycle:
      postStart:
        exec:
          command: ["/bin/sh", "-c", /opt/poststart.sh ]
</code></pre>
