<p>My requirement is to do curl in my init container and mount the results obtain from curl command as file or env variable to pod.</p>
<p>Is it possible to do in init container ?</p>

<p>Yes it is possible. As a file will be easier. The official docs have the exact same example: <a href="https://kubernetes.io/docs/tasks/configure-pod-container/configure-pod-initialization/" rel="nofollow noreferrer">https://kubernetes.io/docs/tasks/configure-pod-container/configure-pod-initialization/</a>. See</p>
<pre><code>volumes:
  - name: workdir
    emptyDir: {}
</code></pre>
<p>Another docs example: <a href="https://kubernetes.io/docs/tasks/access-application-cluster/communicate-containers-same-pod-shared-volume/" rel="nofollow noreferrer">https://kubernetes.io/docs/tasks/access-application-cluster/communicate-containers-same-pod-shared-volume/</a></p>
