<p>We have several pods (as service/deployments) in our k8s workflow that are dependent on each other, such that if one goes into a <code>CrashLoopBackOff</code> state, then all these services need to be redeployed. </p>

<p>Instead of having to manually do this, is there a programatic way of handling this?</p>

<p>Of course we are trying to figure out why the pod in question is crashing.</p>

horcle_buzz
<p>If these are so tightly dependant on each other, I would consider these options
a) Rearchitect your system to be more resilient towards failure and tolerate, if a pod is temporary unavailable
b) Put all parts into one pod as separate containers, making the atomic design more explicit</p>

<p>If these don't fit your needs, you can use the Kubernetes API to create a program that automates the task of restarting all dependent parts. There are client libraries for multiple languages and integration is quite easy. The next step would be a custom resource definition (CRD) so you can manage your own system using an extension to the Kubernetes API.</p>
