I am using openjdk:8-jre-alpine3.9 docker image to run my java app in Kubernetes. I wanted to have thread dump functionality for this running app. The java image doesn't seem to have that jstack or jmeter tool within it.
Any idea how can I achieve thread dump?
Assuming the java
process is PID 1 in the container, you can send it a SIGQUIT and it will emit a thread dump to stdout(?)
kubectl exec $POD_NAME -- kill -QUIT 1
Apologies for the redhat link, I couldn't immediately find the authoritative source for that on oracle.com