I administrate kubernetes clusters running software that is not always perfect. Some have memory leaks, some have cpu leaks, some have both.
I would like to automatically kill the leaking pods. The ones who leak memory are easy, I just put a memory limit and they die eventually when they reach the limit. However CPU seems more tricky. I do not want to put a CPU limit, that will just make them slower and not kill them.
These days I visit regularly the grafana showing the prometheus cpu charts, and once in a while I can spot a pod stuck in an infinite loop, or a pod increasing its CPU usage steadily. I then kill them manually.
I believe no such feature is standard in kubernetes, but I wonder if a plugin exists, or a simple hack.