Basic background
My Application is a Java application, My application is getting deployed in Azure cluster. everything is good. But I want to know how to connect Eclipse debugger with the application running in Azure cluster.
In the startup script, JPDA port is bind with 8000 and in dockerfile 8000 port is exposed.
The issue is how to connect eclipse debugger with code running in Azure cluster.
I tried to put the IP address in
Remote Java Applicationconnection propertiesHost:but not a success.
Need procedure, for remote debugging.
So after googling, I found one ninja technique . A technique we know as
port-forwarding.So basic idea is to forward a running application's port to our local system's available port.
So I found one command for port-forwarding:
In this command, we need to know . For this, we need to know running pods in Kubernetes cluster on Azure. It means we need to connect or authenticate your local machine CLI with Azure.
Now open PowerShell run command
Your default browser will open add your Azure credentials and Authenticate, so your
PowerShellwill show you following message when yourauthenticationis done.Now next command to run is:
Run Command to get running pods in a specific namespace if defined any.
Now you will have your running pods in specific namespace in Kubernetes cluster of Azure cloud.
Time to run our initial command.
In the cli you will see
Might be confused why I use 6000 port, because, my 8000 port is already in use.
Time to connect with eclipse: Project
Right-click>debug>debug configuration> search forRemote Java Application.Set a name for the debugger like mine is debugCluster
Host: 127.0.0.1Port: 6000Now Apply and Press Debug button in some time you will see your debugger is connected with Instance running in Azure cluster.