<p>I'm dealing with a certain service that causes (seemingly unresolvable) memory leaks from time to time. RAM memory inside of the container/pod grows high and stays that way. The pod soon becomes unusable and I would very much like to configure Kubernetes to mark those pods for termination and stop routing to them.</p>
<p>For example, if RAM reaches 80% inside the pod can I configure Kubernetes to shut down such pods?</p>
<p>Any links you can share about this would be great.</p>
<p>Thanks</p>

Gervasius Twinklewinkleson
<pre><code>apiVersion: v1
kind: Pod
metadata:
  name: memory-demo
  namespace: mem-example
spec:
  containers:
  - name: memory-demo-ctr
    image: polinux/stress
    resources:
      limits:
        memory: &quot;200Mi&quot;
</code></pre>
<p>To specify a memory limit: <code>resources:limits</code><br />
when process use more than 200Mi，pod will be killed because it is out of memory (OOM)</p>
