Reputation: 1028
I have 2 pods - P1
& P2
.
P1
is running Nginx Proxy.P2
running an envoy + custom application.Due to some issue, the application stop responding to the requests redirected from P1
.
But locally K8s probes are working fine in P2.
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).
Upvotes: 0
Views: 1319
Reputation: 142532
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).
You have several ways to accomplish that but they are a bit of "hack"
CronJob
Add CronJob
which checks if the pod is responding and if not restart it
kubectl get events
Write your custom "Event Handler" to grab the stop events from the K8S events kubectl get events
. you can fine-tune the events with --field-selector
for example.
Upvotes: 1