Cloud Code for IntelliJ allows you to easily debug your applications deployed to a Kubernetes cluster. You can debug an application on a local cluster (like Minikube or Docker Desktop), GKE, or any other Cloud provider.
Furthermore, with Cloud Code's debugging support, you don't have to worry about any
manual setup like setting up port forwarding or injecting language-specific debug
arguments in the right way. All you need to do is have a Cloud Code-ready Kubernetes application
that includes a
skaffold.yaml configuration file.
Click the debug action for
Kubernetes Continuous Deploy
to start the development cycle in debug mode on your Kubernetes cluster.
The continuous development cycle will then initiate in debug mode.
Once the debugger can be attached, Cloud Code will attach a debug session:
You can now perform all the tasks you normally do when debugging local code, like setting breakpoints and stepping through code, except with the added advantage of debugging against a live Kubernetes cluster:
To end the debugging session, click the stop icon on the
Kubernetes Continuous Deploy Run Configuration.
Cloud Code, powered by Skaffold under the hood, will automatically take care of the following for you:
Adding an environment JAVA_TOOLS_OPTIONS with the appropriate JDWP configuration:
Rewriting the entrypoint to invoke:
dlvdebugger using an Init Container and rewriting the entrypoint to invoke:
dlv exec --headless --continue --accept-multiclient --listen=localhost:56268 --api-version=2, <app> --
- Port forwarding the debug port so that the debugger can be attached.
- Attaching a debugger to one or more debuggable containers in your application.
If your application has multiple debuggable containers (containers whose language is supported by
Cloud Code debug) configured in
skaffold.yaml, then a debugger will be attached to each of these.
For more details, refer to the Skaffold debug documentation.