<p>I'm new to Kubenetes, and would like to clarify the following.</p>

<p>Assume we have a containerized java program (using docker) running in k8s. I need to stop getting requests to a pod when the heap size consumed by JVM reaches a limit. For that can I set the readiness and liveliness probes to certain values, so that I want get further requests to that pod? If so how can I set those values?</p>

<p>Thank you</p>

Pasindu Tennage
<p>Yes this is possible. K8s livinessProbes can be a command.</p>

<p>for instances.</p>

<pre><code>livenessProbe:
  exec:
    command:
    - /bin/sh
    - -c
    - /home/test/check.sh
</code></pre>

<p>If you then write a script that checks the used heap by the JVM you should have the probe that you want.</p>
