简体   繁体   中英

Is it possible to set readiness and liveliness probes from the program?

I'm new to Kubenetes, and would like to clarify the following.

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?

Thank you

Yes this is possible. K8s livinessProbes can be a command.

for instances.

livenessProbe:
  exec:
    command:
    - /bin/sh
    - -c
    - /home/test/check.sh

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM