<p>I have 2 pods - <code>P1</code> &amp; <code>P2</code>.</p>
<ul>
<li><code>P1</code> is running Nginx Proxy.</li>
<li><code>P2</code> running an envoy + custom application.</li>
</ul>
<p>Due to some issue, the application stop responding to the requests redirected from <code>P1</code>.</p>
<p>But locally K8s probes are working fine in P2.<br />
In this condition, Is it possible to restart the P2 based on the Error count seen in P1? (No service mash used in this setup).</p>

Midson
<blockquote>
<p>In this condition, Is it possible to restart the P2 based on the Error count seen in P1? (No service mash used in this setup).</p>
</blockquote>
<p>You have several ways to accomplish that but they are a bit of &quot;hack&quot;</p>
<h3><code>CronJob</code></h3>
<p>Add <code>CronJob</code> which checks if the pod is responding and if not restart it</p>
<h3><code>kubectl get events</code></h3>
<p>Write your custom &quot;Event Handler&quot; to grab the stop events from the K8S events <code>kubectl get events</code>. you can fine-tune the events with <code>--field-selector</code> for example.</p>
<p><a href="https://i.stack.imgur.com/duc6L.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/duc6L.png" alt="enter image description here" /></a></p>
