I am trying to debug a java application deployed in K8S cluster in Kyma.
I am trying to use telepresence for this
I have installed telepresence and have swapped the deployment.
Below are the logs while connecting
T: Forwarding remote port 8080 to local port 8080.
T: Connected. Flushing DNS cache.
T: Setup complete. Launching your command.
The default interactive shell is now zsh.
To update your account to use zsh, please run `chsh -s /bin/zsh`.
For more details, please visit https://support.apple.com/kb/HT208050.
@cba47a8.kyma-stage.shoot.live.k8s-hana.ondemand.com|bash-3.2$
Now when i try to create a remote debug configuration in Eclipse by giving localhost:8080 i am getting connection refused error.
I understood with the logs above that the port forwarding has happened and available as local port.
Best Regards,
Saurav
I think
connection refused
error is not related to Telepresence configuration. When you start your java application, you need to enable remote debugging by providing JVM option-agentlib:jdwp
:More details here
After that you can set Eclipse configuration with
localhost:5005
.Also, I think it's worth mentioning that if you don't need bidirectional communication, you can simply port-forward with
kubectl
command:but don't forget to enable remote debugging in your deployed application.
For Docker image you can define
ENTRYPOINT
asand control enable or not debugging by setting
JAVA_OPTS
environment variable.