<p>I want to know how I can start my deployments in a specific order. I am aware of <code>initContainers</code> but that is not working for me. I have a huge platform with around 20 deployments and 5 statefulsets that each of them has their own service, environment variables, volumes, horizontal autoscaler, etc. So it is not possible (or I don't know how) to define them in another yaml deployment as <code>initContainers</code>.</p>

<p>Is there another option to launch deployments in a specific order?</p>

<p>To create dependency among the deployment, there needs to be a sequence of certain condition true.</p>
<p>For example, Wait for the pod &quot;busybox1&quot; to contain the status condition of type &quot;Ready&quot;.</p>
<pre><code>kubectl wait --for=condition=Ready pod/busybox1
</code></pre>
<p>after that, you can roll out the next deployment.</p>
<p>For further detail see <a href="https://kubernetes.io/docs/reference/generated/kubectl/kubectl-commands" rel="noreferrer">kubectl-wait</a></p>
<p>Here is an another example from @Michael Hausenblas <a href="https://hackernoon.com/kubectl-tip-of-the-day-wait-like-a-boss-40a818c423ac" rel="noreferrer">job-dependencies</a>, having dependencies among the job objects.</p>
<p>If you’d like to kick off another job after worker has completed? Here you go:</p>
<pre><code>$ kubectl -n waitplayground \
             wait --for=condition=complete --timeout=32s \     
             job/worker
job.batch/worker condition met
</code></pre>
