<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>

AVarf
<p>It's possible to order the launch of initContainers in a Pod, or Pods that belong in the same StatefulSet. However, those solutions do not apply to your case.</p>

<p>This is because ordering initialization is not the standard approach for solving your issue. In a microservices architecture, and more specifically Kubernetes, you would write your containers such that they try to call the services they depend on (whether they are up or not) and if they aren't available, you let your containers crash. This works because Kubernetes provides a <a href="https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#restart-policy" rel="noreferrer">self-healing mechanism</a> that automatically restarts containers if they fail. This way, your containers will try to connect to the services they depend on, and if the latter aren't available,  the containers will crash and try again later using exponential back-off.</p>

<p>By removing unnecessary dependencies between services, you simplify the deployment of your application and reduce coupling between different services.</p>
