Debug Kubernetes applications with Cloud Code for IntelliJ
Stay organized with collections
Save and categorize content based on your preferences.
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), Google Kubernetes Engine, or any other Cloud provider.
With Cloud Code's debugging support, you skip manual setup like
setting up port forwarding, installing a debugging backend, or injecting
language-specific debug arguments in the right way. All you need is a
Cloud Code-ready Kubernetes application that includes a
skaffold.yaml configuration file.
With Cloud Code, you can set breakpoints and
debug 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 to
enable debugging. If JAVA_TOOL_OPTIONS is already present,
Cloud Code uses existing settings specified in
JAVA_TOOL_OPTIONS.
Node.js
Depending on the structure of your application and its image build
configuration, you might have to help the debugger map your local sources
to the remote sources in the container. This enables the Node debugger
to correctly process your breakpoints.
You can configure this in one of the following ways:
Manual configuration
Select the Develop on Kubernetes Run Configuration from the dropdown
and then click Edit Configurations. On the Debug tab, configure the
source mapping from your local application source to the source
location in the remote container.
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 you
start your debug session, Cloud Code attempts to infer
this mapping automatically. The inferred mapping is presented to you in a
dialog; one dialog for each artifact you are debugging.
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 click
Cancel, no mapping is applied.
Go
To configure your application for debugging, your app must be a
Go Module-based application
and be identified as being Go-based by setting one of the
standard Go runtime environment variables
in the container, such as GODEBUG, GOGC, GOMAXPROCS, or
GOTRACEBACK. GOTRACEBACK=single is the default setting for Go
and GOTRACEBACK=all is a generally useful configuration.
Optionally (but recommended), your app should be built with the
-gcflags='all=-N -l' options to disable optimizations. Skaffold
Profiles are a useful
option for this purpose and can be set with the Deployment Profile
field in your Run configuration on the Build/Deploy tab.
Python
To configure your application for debugging, ensure you meet the following
prerequisites:
IDE, edition, and plugin are compatible
For compatible IDEs, editions, and plugins, see
Supported IDEs.
Skaffold version is 1.25.0 or greater
You can allow Cloud Code to manage your dependencies,
or point to a local Skaffold installation. See Preferences > 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 run pydevd, the
underlying Python debugger.
IDE
How to configure
IntelliJ IDEA
Python debugging with Cloud Code requires a
Python SDK to be configured for your project.
Go to File
> Project Structure and add a Python SDK in the Project
tab. If none exists, add one under the SDK tab.
PyCharm
Go to File > Settings > Project > Python Interpreter or
for Mac OS X, PyCharm > Preferences > Project > Python
Interpreter, and add a Python interpreter.
You can now perform the tasks you normally do when debugging local code,
like setting breakpoints and stepping through code, against a live
Kubernetes cluster.
To end the debugging session, click the stop icon on the
Develop on Kubernetes Run Configuration.
To submit feedback or report an issue in your IntelliJ IDE, go to
Tools > Cloud Code > Help / About > Submit
feedback or report an issue to report an issue on GitHub.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-07 UTC."],[[["\u003cp\u003eCloud Code for IntelliJ enables debugging of applications deployed to Kubernetes clusters, including local clusters, Google Kubernetes Engine, or other cloud providers.\u003c/p\u003e\n"],["\u003cp\u003eDebugging support in Cloud Code eliminates the need for manual setup, such as port forwarding, debugging backend installation, or language-specific debug argument injection, for supported languages.\u003c/p\u003e\n"],["\u003cp\u003eCloud Code allows for debugging while actively making changes and iterating on the source code of an application.\u003c/p\u003e\n"],["\u003cp\u003eSupported languages for debugging include Java, Kotlin, Node.js, Go, and Python, with specific IDE and plugin requirements for each.\u003c/p\u003e\n"],["\u003cp\u003eCloud Code offers both manual and automatic configurations for mapping local source code to remote sources in containers for Node.js applications, and it also has specific configurations needed for Go and Python apps.\u003c/p\u003e\n"]]],[],null,["# Debug Kubernetes applications with Cloud Code for IntelliJ\n\n| **Note:** Debugging support is available for Java, Kotlin, Node.js, Go, and Python.\n\nCloud Code for IntelliJ allows you to easily debug your applications deployed to a\nKubernetes cluster. You can debug an application on a local cluster (like\nminikube or Docker Desktop), Google Kubernetes Engine, or any other Cloud provider.\n\nWith Cloud Code's debugging support, you skip manual setup like\nsetting up port forwarding, installing a debugging backend, or injecting\nlanguage-specific debug arguments in the right way. All you need is a\nCloud Code-ready Kubernetes application that includes a\n`skaffold.yaml` configuration file.\n\nCloud Code also enables you to [debug an application while making\nchanges to, and iterating on, source code](/code/docs/intellij/watch-modes#applying-changes-while-debugging).\n\nSupported IDEs\n--------------\n\nThe following table lists the languages and IDEs that Cloud Code supports for\ndebugging. The table also lists the required plugins, where applicable:\n\nFor more information about IDE support, see\n[Supported JetBrains IDEs](/code/docs/intellij/ides).\n\nWith Cloud Code, you can set breakpoints and\ndebug remote applications running in containers for the following languages: \n\n### Java\n\nCloud Code automatically adds an environment variable,\n`JAVA_TOOL_OPTIONS`, with the appropriate JDWP configuration to\nenable debugging. If `JAVA_TOOL_OPTIONS` is already present,\nCloud Code uses existing settings specified in\n`JAVA_TOOL_OPTIONS`.\n\n### Node.js\n\nDepending on the structure of your application and its image build\nconfiguration, you might have to help the debugger map your local sources\nto the remote sources in the container. This enables the Node debugger\nto correctly process your breakpoints.\n\nYou can configure this in one of the following ways:\n\n- **Manual configuration**\n\n Select the **Develop on Kubernetes** Run Configuration from the dropdown\n and then click **Edit Configurations** . On the **Debug** tab, configure the\n source mapping from your local application source to the source\n location in the remote container.\n\n Configuration options:\n - **File/directory** - the local file or directory of your application running on Kubernetes.\n - **Remote path** - the path to the file or directory running in the container on Kubernetes.\n- **Automatic configuration**\n\n You can choose to defer this mapping to Cloud Code. When you\n start your debug session, Cloud Code attempts to infer\n this mapping automatically. The inferred mapping is presented to you in a\n dialog; one dialog for each artifact you are debugging.\n\n Configuration options:\n - **Local path** - the local path to the root of the artifact you are debugging.\n - **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 click **Cancel**, no mapping is applied.\n\n | **Note:** Automatic mapping is a best effort guess based on heuristics.\n\n### Go\n\nTo configure your application for debugging, your app must be a\n[Go Module](https://blog.golang.org/using-go-modules)-based application\nand be identified as being Go-based by setting one of the\n[standard Go runtime environment variables](https://godoc.org/runtime)\nin the container, such as `GODEBUG`, `GOGC`, `GOMAXPROCS`, or\n`GOTRACEBACK`. `GOTRACEBACK=single` is the default setting for Go\nand `GOTRACEBACK=all` is a generally useful configuration.\n\nOptionally (but recommended), your app should be built with the\n`-gcflags='all=-N -l'` options to disable optimizations. Skaffold\n[Profiles](https://skaffold.dev/docs/environment/profiles/) are a useful\noption for this purpose and can be set with the **Deployment Profile**\nfield in your Run configuration on the **Build/Deploy** tab.\n\n### Python\n\nTo configure your application for debugging, ensure you meet the following\nprerequisites:\n\n- **IDE, edition, and plugin are compatible**\n\n For compatible IDEs, editions, and plugins, see\n [Supported IDEs](#supported_ides).\n- **Skaffold version is 1.25.0 or greater**\n\n You can allow Cloud Code to [manage your dependencies](/code/docs/intellij/install#managed_dependencies),\n or point to a local Skaffold installation. See **Preferences \\\u003e Tools \\\u003e\n Cloud Code \\\u003e Dependencies**.\n- **Python interpreter is configured**\n\n Without a Python interpreter configured in your project,\n debugging won't work, as there is no way to run `pydevd`, the\n underlying Python debugger.\n\n \u003cbr /\u003e\n\n \u003cbr /\u003e\n\nFor more information, see the [Skaffold debug\ndocumentation](https://skaffold.dev/docs/workflows/debug/).\n\nDebug an application\n--------------------\n\n1. To start the development cycle in debug mode on your Kubernetes cluster,\n click the debug action for\n **Develop on Kubernetes**.\n\n The [continuous development cycle](/code/docs/intellij/speed-up-k8s-development#continuous_development_on_kubernetes)\n initiates in debug mode.\n\n Cloud Code attaches a debug session:\n\n2. You can now perform the tasks you normally do when debugging local code,\n like setting breakpoints and stepping through code, against a live\n Kubernetes cluster.\n\n3. To end the debugging session, click the stop icon on the\n **Develop on Kubernetes** Run Configuration.\n\nWhat's next\n-----------\n\n- Use [file sync and hot reloading](/code/docs/intellij/speed-up-k8s-development#enable-skaffold-file-sync-and-hot-reloading) to speed up development.\n- Set up a [continuous development](/code/docs/intellij/speed-up-k8s-development#continuous_development_on_kubernetes) environment in Cloud Code.\n- [View Kubernetes logs](/code/docs/intellij/view-logs) in Cloud Code.\n\nGet support\n-----------\n\nTo submit feedback or report an issue in your IntelliJ IDE, go to **Tools** \\\u003e **Cloud Code** \\\u003e **Help / About** \\\u003e **Submit\nfeedback or report an issue** to report an issue on [GitHub](https://github.com/GoogleCloudPlatform/cloud-code-intellij/issues)."]]