How to find out pod caused deadlock on shared storage (eg. database) and kill it

Hello,

How to manage k8 cluster manager to avoid (starvation) state of cluster. When group of same pods will be blocked by only one pod.

Pod1: dealocked database = slow response need to find it and to kill it
Pod2: blocked by Pod1 = slow response
Pod3: blocked by Pod1 = slow response
Pod(n): will be created all pods are slow - this is a problem

How to manage / configure and setup the cluster (or rewrite application logic)?

You might be able to do what you want with a mixture of Liveness, Readiness and Startup probes. Liveness probes will restart a pod under certain conditions (e.g. deadlock). If you need something more coordinated with better built in application logic, you may want to look at developing an Operator that can take some custom actions for you.

Thank you. I am going to study the sources (probes, operator) to understand how they work in detail.