<p>Lets say I have 3 containers X,Y and Z. I want container Y to start only after container X is running, and container Z to start only after Y is running.</p>

<p>How do I do this?</p>

<p>You should consider to redesign your application parts if they have such heavy dependencies, then they should maybe not be split to different containers or you should use some decoupeling to avoid</p>

<p>What you could do is to:</p>

<ol>
<li>Have one ore more <a href="https://kubernetes.io/docs/concepts/abstractions/init-containers/#init-containers-in-use" rel="nofollow noreferrer">init containers</a></li>
<li>Have a <a href="https://docs.docker.com/engine/reference/builder/#entrypoint" rel="nofollow noreferrer">entrypoint script</a> within each of the containers which blocks until the dependency is fulfilled</li>
<li>Implement something outside the cluster which controls which pods are started.</li>
<li>Write a <a href="https://www.youtube.com/watch?v=66NzGKJpyyg" rel="nofollow noreferrer">custom controller</a></li>
</ol>
