Start pod when other pod is ready

Hello I’m sort of new on k8s and I was wondering if it’s possible to implement the following logic.

I have containerA and containerB each container runs in a separate node. I would like to now if it’s possible to launch the pod of containerA only when containerB is running

What happens when containerB crashes or is otherwise unavailable?

One possible approach could be to add an init container beside containerA (in the same Pod), that would check that containerB is running (assuming that it would know how to do it - e.g., via an exposed Service), and possibly fail otherwise (or just wait). But depending on the actual goal you are trying to achieve, this might not be enough (e.g., failure conditions, as suggested by @thockin).