<p>I have 2 pods running in my kubernates cluster. One is simple a wordpress application and the 2nd one contains a mysql DB. Now wordpress is communicating with mysql DB. </p>

<p>I want to find this dependancies between pods. Is there any kubectl command or any tool like prometheus by which I can find dependancies between pods inside kubernates cluster?</p>

<p>No, there is no native kubernetes primitive which can define dependencies between pods. An easy thing you can do is to define labels like <code>dependsOn</code> and attach them to the corresponding pod.</p>

<p>For example, your <code>wordpress</code> pod can have a label which says <code>dependsOn: mysql</code> where <code>mysql</code> can either be the name or another label of your <code>mysql</code> pod.</p>

<p>But this will only help a human reader understand what this pod is dependent on. Kubernetes works on the principle of eventual consistency. Even if mysql doesn't start before wordpress, eventually they will start working together and system will become consistent. The wordpress pod will crash when it cannot find mysql and Kubernetes will keep restarting crashing pods.</p>

<p>If you want to define dependencies between applications on Kubernetes and require deployments to happen in a particular order etc. you can take a look at tools like <a href="http://aptomi.io/" rel="nofollow noreferrer">Aptomi</a>.</p>
