<p>I need to start kubernetes pods in a sequence like pod2 should start only when pod1 is up and running.</p>

<p>we can do this in <code>docker-compose.yml</code> using <code>depends_on</code></p>

sam
<p>No, there is no built-in dependency management equivalent to <code>depends_on</code> available. In general, we assume loosely coupled services and as a good practice there should be no hard dependency in terms of start-up order, but retries and timeouts should be used. If you have to hardcode dependencies, you can use <a href="https://kubernetes.io/docs/concepts/workloads/pods/init-containers/" rel="noreferrer">init containers</a>. In your case, a init container in <code>pod2</code> could simply query if <code>pod1</code> (or better: the service in front of it) is ready in a while loop. The main container in <code>pod2</code> is guaranteed only to be launched if and when the init container exits successfully. </p>
