<p>I have a docker image that when created should check if the volume is empty, in case it should initialize it with some data. 
This saved data must remain available for other pods with the same or different image.</p>

<p><a href="https://i.stack.imgur.com/2sJos.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/2sJos.png" alt="enter image description here"></a></p>

<p>What do you recommend me to do?</p>

<p>I assume you create your pods using Deployment object in Kubernetes. What you want to look into is a StatefulSet, which, in opposite to deployments, retains some identity aspects for recreated pods including to some extent network and storage.</p>

<p>It was introduced specifically as a means to run services that need to keep their state in kube cluster (ie. running databases queues etc.)</p>
