Stay organized with collections Save and categorize content based on your preferences.
Deploy a Kubernetes app with Cloud Code for IntelliJThis 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.
Before you beginIf you'd like to use Google Cloud, you'll need to create or select a Google Cloud project and enable billing on your project.
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.Alternatively, you can use a cluster hosted on any other cloud platform or a local Kubernetes cluster with tools such as minikube and Docker Desktop.
Install Git so that Cloud Code can perform Git operations, like cloning a sample.
Install the Cloud Code plugin if you haven't already.
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.
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 clusterIf 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 clusterIf 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 applicationTo initiate development of your application on Kubernetes:
If you're running on a cluster hosted on a cloud platform, ensure you have defined where your container images are stored for Develop 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.
Cloud Code supports applying changes while debugging.
To debug your application:
Click the debug action for Develop on Kubernetes to start the development cycle in debug mode on your Kubernetes cluster.
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.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.
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.
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:
Select the project you created for this Quickstart and click the trash can icon next to delete it.
This shuts down the project and schedules it for deletion.
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-08-07 UTC.
[[["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."],[[["This 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."],["You 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."],["Cloud Code facilitates iterative development with continuous rebuilding, allowing you to automatically build, push, and deploy code changes to your Kubernetes cluster."],["The guide demonstrates how to debug your application directly on your Kubernetes cluster using Cloud Code's debugging features, including setting breakpoints and viewing logs."],["You 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."]]],[]]
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4