Stay organized with collections
Save and categorize content based on your preferences.
Deploy a Kubernetes app with Cloud Code for IntelliJ
This page shows you how to get started with Cloud Code.
In this quickstart, you'll set up a new Kubernetes application using a starter
Hello World template, run your app on a cluster of your choosing, kickstart
continuous rebuilding to iteratively develop your app, debug your
running code, and sit back and view logs streaming from your live application.
Cloud Code comes with a collection of
code sample
templates to get you started quickly. To create a new application using an
existing sample:
In your IDE, open File > New Project and select
Cloud Code: Kubernetes.
Select a Hello World template from the list of starter applications.
Pick a name for your project.
After you click Finish, Cloud Code clones your chosen
template and opens your newly created project for use.
For Java templates, you're prompted to import required Maven projects to
sync your pom.xml. Click Add as Maven project and then click Import
Changes.
Choosing a cluster
In order to develop your application, you'll need an associated Kubernetes cluster
(hosted either locally with minikube or using a cloud platform, like a
Google Kubernetes Engine cluster).
Local cluster
If you don't already have a cluster to use for this quickstart, you can choose
to run your application with a Cloud Code-managed local minikube cluster.
Cloud Code starts a minikube cluster to run your application and
stops the cluster when deployment stops. If a minikube cluster is already
running, Cloud Code reuses the existing minikube cluster for deployment.
You can choose to use this Cloud Code-managed minikube cluster in the
next step, developing your application, by
setting it as your deployment preference.
Cloud platform-based cluster
If you already have a cluster configured to work with Kubernetes tools (like
kubectl) that you can use for this quickstart, Cloud Code deploys
to it automatically. You can move on to developing your application
where you can confirm your preferred cluster is set as your current context.
If you don't, you can create one using your cloud platform-specific
instructions. For GKE, you can follow the
Creating a cluster guide.
Developing your application
To initiate development of your application on Kubernetes:
If you're logged into Google Cloud in your IDE and you have a
default project defined, Cloud Code automatically uses your
default container image repository (gcr.io/{project_id} where {project_id}
references your default project).
Ensure your preferred Kubernetes context is set. This can be specified in
your Develop on Kubernetes configuration (accessible through
Run > Edit Configurations > Develop on Kubernetes), on the Run
tab and in the Deployment preferences section.
You can choose to deploy to a current context (default), locally to a
minikube cluster, or to another available context.
By default, your Kubernetes application will run in On-demand mode
with On demand selected. If preferred, you can select the On file save option instead.
Choose the Develop on Kubernetes run target from the Run/Debug
configuration selector in the Navigation bar.
This ensures any code changes to be automatically built, pushed, and deployed
to a new version of your application.
To start the development cycle on your Kubernetes cluster, click the run
action for Develop on Kubernetes.
In the output window, on the Logs tab, view incoming application
logs.
After the deployment has started, you'll see the list of forwarded ports for
the deployed application.
When the deployment is successful, you're notified that new service URLs are
available. Click the Service URLs tab to view the URL(s), then click the
URL link to open your browser with your running application.
Alternatively, you can open the Event Log and then click the link to open
your browser with your running application.
The Deployed Resources pane shows what you deployed during the
development session.
Click the debug action
for Develop on Kubernetes to start the development cycle in debug mode
on your Kubernetes cluster.
Cloud Code will attach a debug session. When successful, the
Debug Tool window opens, confirming connection (on the Console tab).
You can now debug against your live Kubernetes cluster.
Click the gutter at the executable line of the code where you want to add
a breakpoint.
Red filled circles denote active breakpoints, while red-outlined hollow
circles signify disabled breakpoints.
When you send a new request to your application, it will pause at that
desired line.
To end the debugging session, click the stop icon on the
Develop on Kubernetes run configuration.
Viewing logs
In addition to seeing a livestream of the logs from running pods in the terminal
output as you're developing and running your application, you can view logs from
a specific pod by navigating to the Kubernetes Explorer.
To view logs from a specific pod, follow these steps:
Navigate to the Kubernetes Explorer. It can be
accessed either from the side panel on the right or
using Tools > Cloud Code > Kubernetes > View Cluster Explorer.
Select the pod you'd like to see logs from.
Right-click the pod and then select Stream Logs. Alternatively, you can stream logs for individual containers running in pods.
This outputs logs to the Kubernetes Explorer Console.
Clean up
To avoid incurring charges to your Google Cloud account for
the resources used on this page, follow these steps.
Go to the Projects page in the Google Cloud console:
[[["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-25 UTC."],[[["\u003cp\u003eThis guide provides instructions on how to deploy a Kubernetes application using Cloud Code for IntelliJ, covering setup, creating a new application, choosing a cluster, and developing.\u003c/p\u003e\n"],["\u003cp\u003eYou can use either a local minikube cluster managed by Cloud Code or a cluster hosted on a cloud platform like Google Kubernetes Engine (GKE) to deploy and run your application.\u003c/p\u003e\n"],["\u003cp\u003eCloud Code facilitates iterative development with continuous rebuilding, allowing you to automatically build, push, and deploy code changes to your Kubernetes cluster.\u003c/p\u003e\n"],["\u003cp\u003eThe guide demonstrates how to debug your application directly on your Kubernetes cluster using Cloud Code's debugging features, including setting breakpoints and viewing logs.\u003c/p\u003e\n"],["\u003cp\u003eYou can monitor your application's performance by streaming logs from individual pods via the Kubernetes Explorer, and can clean up the resources that are used to avoid incurring any charges.\u003c/p\u003e\n"]]],[],null,["# Quickstart: Deploy a Kubernetes app with Cloud Code for IntelliJ\n\nDeploy a Kubernetes app with Cloud Code for IntelliJ\n====================================================\n\nThis page shows you how to get started with Cloud Code.\n\nIn this quickstart, you'll set up a new Kubernetes application using a starter\nHello World template, run your app on a cluster of your choosing, kickstart\ncontinuous rebuilding to iteratively develop your app, debug your\nrunning code, and sit back and view logs streaming from your live application.\n\nBefore you begin\n----------------\n\n1. If you'd like to use Google Cloud, you'll need to\n [create or select a Google Cloud project](https://console.cloud.google.com/projectcreate)\n and [enable billing on your project](/billing/docs/how-to/modify-project).\n\n | **Note:** To get the most out of this quickstart, creating a Google Cloud project is recommended. This will allow you to easily create and work with a live GKE cluster, leverage Cloud Code's continuous delivery offering, and utilize its live debugging capabilities.\n\n Alternatively, you can use a cluster hosted on any other cloud platform or a\n local Kubernetes cluster with tools such as\n [minikube](https://kubernetes.io/docs/tasks/tools/install-minikube) and\n [Docker Desktop](https://www.docker.com/products/docker-desktop).\n2. Install [Git](https://git-scm.com/downloads) so that Cloud Code\n can perform Git operations, like cloning a sample.\n\n3. Install the [Cloud Code plugin](/code/docs/intellij/install#installing)\n if you haven't already.\n\nCreating an application\n-----------------------\n\nCloud Code comes with a collection of\n[code sample](https://github.com/GoogleCloudPlatform/cloud-code-samples#readme)\ntemplates to get you started quickly. To create a new application using an\nexisting sample:\n\n1. In your IDE, open **File** \\\u003e **New Project** and select\n **Cloud Code: Kubernetes**.\n\n2. Select a **Hello World** template from the list of starter applications.\n\n3. Pick a name for your project.\n\n After you click **Finish**, Cloud Code clones your chosen\n template and opens your newly created project for use.\n\n For **Java** templates, you're prompted to import required Maven projects to\n sync your pom.xml. Click **Add as Maven project** and then click **Import\n Changes**.\n\nChoosing a cluster\n------------------\n\nIn order to develop your application, you'll need an associated Kubernetes cluster\n(hosted either locally with minikube or using a cloud platform, like a\nGoogle Kubernetes Engine cluster).\n\n### Local cluster\n\nIf you don't already have a cluster to use for this quickstart, you can choose\nto run your application with a Cloud Code-managed local minikube cluster.\nCloud Code starts a minikube cluster to run your application and\nstops the cluster when deployment stops. If a minikube cluster is already\nrunning, Cloud Code reuses the existing minikube cluster for deployment.\n\nYou can choose to use this Cloud Code-managed minikube cluster in the\nnext step, [developing your application](#developing_your_application), by\nsetting it as your deployment preference.\n\n### Cloud platform-based cluster\n\nIf you already have a cluster configured to work with Kubernetes tools (like\nkubectl) that you can use for this quickstart, Cloud Code deploys\nto it automatically. You can move on to [developing your application](#developing_your_application)\nwhere you can confirm your preferred cluster is set as your current context.\n\nIf you don't, you can create one using your cloud platform-specific\ninstructions. For GKE, you can follow the\n[Creating a cluster](https://cloud.google.com/kubernetes-engine/docs/how-to/creating-a-cluster) guide.\n\nDeveloping your application\n---------------------------\n\nTo initiate development of your application on Kubernetes:\n\n1. If you're running on a cluster hosted on a cloud platform, ensure you have\n [defined where your container images are stored](/code/docs/intellij/configuring-container-image-settings#specifying_where_container_images_are_stored)\n for **Develop on Kubernetes**.\n\n If you're logged into Google Cloud in your IDE and you have a\n default project defined, Cloud Code automatically uses your\n default container image repository (gcr.io/{project_id} where {project_id}\n references your default project).\n2. Ensure your preferred Kubernetes context is set. This can be specified in\n your Develop on Kubernetes configuration (accessible through\n **Run** \\\u003e **Edit Configurations** \\\u003e **Develop on Kubernetes**), on the Run\n tab and in the Deployment preferences section.\n\n You can choose to deploy to a current context (default), locally to a\n minikube cluster, or to another available context.\n\n By default, your Kubernetes application will run in [On-demand mode](/code/docs/intellij/watch-modes)\n with **On demand** selected. If preferred, you can select the **On file save** option instead.\n3. Choose the **Develop on Kubernetes** run target from the Run/Debug\n configuration selector in the Navigation bar.\n\n This ensures any code changes to be automatically built, pushed, and deployed\n to a new version of your application.\n4. To start the development cycle on your Kubernetes cluster, click the run\n action for **Develop on Kubernetes**.\n\n5. In the **output window** , on the **Logs** tab, view incoming application\n logs.\n\n After the deployment has started, you'll see the list of forwarded ports for\n the deployed application.\n6. When the deployment is successful, you're notified that new service URLs are\n available. Click the **Service URLs** tab to view the URL(s), then click the\n URL link to open your browser with your running application.\n\n Alternatively, you can open the **Event Log** and then click the link to open\n your browser with your running application.\n\n The **Deployed Resources** pane shows what you deployed during the\n development session.\n\nDebugging your application\n--------------------------\n\n| **Note:** Debugging support is available for Java, Kotlin, Node.js, Go, and Python.\n\nCloud Code supports [applying changes while debugging](/code/docs/intellij/watch-modes#applying-changes-while-debugging).\n\nTo debug your application:\n\n1. Click the debug action\n for **Develop on Kubernetes** to start the development cycle in debug mode\n on your Kubernetes cluster.\n\n | **Note:** For Node.js apps, you will be prompted to help the debugger map your local sources to the remote sources in the container for each artifact you are debugging. This enables the Node debugger to correctly process your breakpoints. For more on how to configure this setting, refer to the [Debugging an app guide](/static/code/docs/intellij/debug#node.js).\n2. Cloud Code will attach a debug session. When successful, the\n Debug Tool window opens, confirming connection (on the Console tab).\n\n You can now debug against your live Kubernetes cluster.\n3. Click the gutter at the executable line of the code where you want to add\n a breakpoint.\n\n Red filled circles denote active breakpoints, while red-outlined hollow\n circles signify disabled breakpoints.\n4. When you send a new request to your application, it will pause at that\n desired line.\n\n5. To end the debugging session, click the stop icon on the\n `Develop on Kubernetes` run configuration.\n\nViewing logs\n------------\n\nIn addition to seeing a livestream of the logs from running pods in the terminal\noutput as you're developing and running your application, you can view logs from\na specific pod by navigating to the Kubernetes Explorer.\n\nTo view logs from a specific pod, follow these steps:\n\n1. Navigate to the Kubernetes Explorer. It can be\n accessed either from the side panel on the right or\n using **Tools** \\\u003e **Cloud Code** \\\u003e **Kubernetes** \\\u003e **View Cluster Explorer**.\n\n2. Select the pod you'd like to see logs from.\n\n3. Right-click the pod and then select **Stream Logs**. Alternatively, you can stream logs for individual containers running in pods.\n\n This outputs logs to the Kubernetes Explorer Console.\n\nClean up\n--------\n\n\nTo avoid incurring charges to your Google Cloud account for\nthe resources used on this page, follow these steps.\n\n1. Go to the Projects page in the Google Cloud console:\n\n [Go to the Projects page](https://console.cloud.google.com/project)\n2. Select the project you created for this Quickstart and click the trash can\n icon next to delete it.\n\n This shuts down the project and schedules it for deletion.\n\nWhat's next\n-----------\n\n- Consider importing an existing application, either a [Kubernetes](/code/docs/intellij/use-k8s-existing-app) or [App Engine](/code/docs/intellij/migrate) app, into your IDE and getting set up with Cloud Code.\n- Dive deeper into developing Kubernetes applications:\n - Tackle more advanced Google Cloud and Kubernetes configuration with Cloud Code's [YAML editing support](/code/docs/intellij/yaml-editing).\n - For better insight into and management of your Kubernetes resources, use [the Kubernetes Explorer](/code/docs/intellij/use-kubernetes-explorer).\n - [Deploy your applications to ARM64, AMD64, or mixed-architecture GKE clusters](/code/docs/intellij/deploy-to-arm-amd-mixed-arch).\n- Create, run, debug, and deploy an [App Engine app with Cloud Code](/code/docs/intellij/create-standard).\n- [Manage Cloud APIs and client libraries](/code/docs/intellij/client-libraries) from the comfort of your IDE.\n- [Explore your Cloud Storage content](/code/docs/intellij/gcs) within your IDE.\n- Add new projects to and check out existing ones from [Cloud Source Repositories\n with Cloud Code](/code/docs/intellij/vcs)."]]