<p>If I have containers A and B in a pod.. Can i define the failure condition in a pod?? Let's say if container B is not up and running or if its status is exited then spin up another pod with the same set of containers ? An example of configuration file if any ?</p>

<p>A PodSpec has a <code>restartPolicy</code> field with possible values <code>Always</code>, <code>OnFailure</code>, and <code>Never</code>.If a container fails, it is restarted according to its <code>restart</code> policy. Other containers in the same Pod aren't affected. So it does not create a completely new pod if one of the containers fails.</p>
<p>The problem if you use pod is that it's not restarted into another node. For that you should use a higher level controller such as deployment.</p>
<p>Additionally you should define readiness and liveness probe for each container. So kubernetes will remove that container PORT from services if the probe fails.</p>
<p>So with all these you really don't need to worry about creating a new pod if one of the container fails.</p>
