Debug Kubernetes applications with Cloud Code for IntelliJ

Note: Debugging support is available for Java, Kotlin, Node.js, Go, and Python.

Cloud Code for IntelliJ allows you to easily debug your applications deployed to aKubernetes cluster. You can debug an application on a local cluster (likeminikube or Docker Desktop), Google Kubernetes Engine, or any other Cloud provider.

With Cloud Code's debugging support, you skip manual setup likesetting up port forwarding, installing a debugging backend, or injectinglanguage-specific debug arguments in the right way. All you need is aCloud Code-ready Kubernetes application that includes askaffold.yaml configuration file.

Cloud Code also enables you todebug an application while makingchanges to, and iterating on, source code.

Supported IDEs

The following table lists the languages and IDEs that Cloud Code supports fordebugging. The table also lists the required plugins, where applicable:

LanguageSupported IDEs and editionsRequired plugin
JavaIntelliJ IDEA UltimateN/A
IntelliJ IDEA CommunityN/A
GoIntelliJ IDEA UltimateGo plugin
GoLandN/A
Node.jsIntelliJ IDEA UltimateNode.js plugin
WebStormN/A
PythonIntelliJ IDEA UltimatePython plugin
PyCharm ProfessionalN/A

For more information about IDE support, seeSupported JetBrains IDEs.

With Cloud Code, you can set breakpoints anddebug remote applications running in containers for the following languages:

Java

Cloud Code automatically adds an environment variable,JAVA_TOOL_OPTIONS, with the appropriate JDWP configuration toenable debugging. IfJAVA_TOOL_OPTIONS is already present,Cloud Code uses existing settings specified inJAVA_TOOL_OPTIONS.

Node.js

Depending on the structure of your application and its image buildconfiguration, you might have to help the debugger map your local sourcesto the remote sources in the container. This enables the Node debuggerto correctly process your breakpoints.

You can configure this in one of the following ways:

  • Manual configuration

    Select theDevelop on Kubernetes Run Configuration from the dropdownand then clickEdit Configurations. On theDebug tab, configure thesource mapping from your local application source to the sourcelocation in the remote container.

    Choosing a source location in the source mapping section of the Debug tab

    Configuration options:

    • File/directory - the local file or directory of your application running on Kubernetes.
    • Remote path - the path to the file or directory running in the container on Kubernetes.
  • Automatic configuration

    You can choose to defer this mapping to Cloud Code. When youstart your debug session, Cloud Code attempts to inferthis mapping automatically. The inferred mapping is presented to you in adialog; one dialog for each artifact you are debugging.

    Remote path mapping dialog for each artifact specifying remote path being used

    Configuration options:

    • Local path - the local path to the root of the artifact you are debugging.
    • Remote path - the path to the file or directory running in the container on Kubernetes. You can choose to override this with your own value. If you clickCancel, no mapping is applied.
    Note: Automatic mapping is a best effort guess based on heuristics.

Go

To configure your application for debugging, your app must be aGo Module-based applicationand be identified as being Go-based by setting one of thestandard Go runtime environment variablesin the container, such asGODEBUG,GOGC,GOMAXPROCS, orGOTRACEBACK.GOTRACEBACK=single is the default setting for GoandGOTRACEBACK=all is a generally useful configuration.

Optionally (but recommended), your app should be built with the-gcflags='all=-N -l' options to disable optimizations. SkaffoldProfiles are a usefuloption for this purpose and can be set with theDeployment Profilefield in your Run configuration on theBuild/Deploy tab.

Python

To configure your application for debugging, ensure you meet the followingprerequisites:

  • IDE, edition, and plugin are compatible

    For compatible IDEs, editions, and plugins, seeSupported IDEs.

  • Skaffold version is 1.25.0 or greater

    You can allow Cloud Code tomanage your dependencies, or point to a local Skaffold installation. SeePreferences > Tools > Cloud Code > Dependencies.

  • Python interpreter is configured

    Without a Python interpreter configured in your project, debugging won't work, as there is no way to runpydevd, the underlying Python debugger.

    IDEHow to configure
    IntelliJ IDEAPython debugging with Cloud Code requires a Python SDK to be configured for your project.

    Go toFile > Project Structure and add a Python SDK in theProject tab. If none exists, add one under theSDK tab.
    PyCharmGo toFile > Settings > Project > Python Interpreter or for Mac OS X,PyCharm > Preferences > Project > Python Interpreter, and add a Python interpreter.

For more information, see theSkaffold debugdocumentation.

Debug an application

  1. To start the development cycle in debug mode on your Kubernetes cluster,click the debug action forrun action iconDevelop on Kubernetes.

    Starting the Kubernetes cluster development cycle in debug mode

    Thecontinuous development cycleinitiates in debug mode.

    Cloud Code attaches a debug session:

    Kubernetes debugger attached

  2. You can now perform the tasks you normally do when debugging local code,like setting breakpoints and stepping through code, against a liveKubernetes cluster.

    Kubernetes debugger session

  3. To end the debugging session, click the stop icon on theDevelop on Kubernetes Run Configuration.

What's next

Get support

To submit feedback or report an issue in your IntelliJ IDE, go toTools >Cloud Code >Help / About >Submitfeedback or report an issue to report an issue onGitHub.

Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2026-02-19 UTC.