Debugging Java applications in containers on OpenShift

preview_player
Показать описание
In this video I quickly demonstrate how you can step-debug through Java applications running in containers on OpenShift. Using the OpenShift "oc" client and Visual Studio Code, I demonstrate how you can set breakpoints in your IDE and debug your applications running in the cloud.

The environment variable I add to the container is: "JAVA_OPTS_APPEND=-agentlib:jdwp=transport=dt_socket,address=8787,server=y,suspend=n"
Рекомендации по теме
Комментарии
Автор

We use a config map for this and have the JAVA_OPTIONS "hard coded" in our repository with the debug env value from your description. I am able to connect to the debug port and it all works fine, but the pod crashes if the debug point is active for too long (~3 seconds) any idea how to fix the pod crashing?

hasnaouiahmed
Автор

Hi Duncon,
I went through the Video thanks for explaining in detail of debugging Java application deployed in OpenShift.
I have OpenShift cluster in RHEL. I want to debug java application from eclipse from my windows machine. I followed the steps.
1) Adding JAVA_OPTIONS in the deployment config of the application.
2) oc port-forward <POD> 8787:8787
3) Now when i try to do start the remote debugger from eclipse it is not connecting to the application.
(host : localhost and port : 8787)

balaji