이 빠른 시작에서는 시작 Hello World 템플릿을 사용하여 새 Kubernetes 애플리케이션 설정, 선택한 클러스터에서 앱 실행, 앱을 반복적으로 개발할 수 있도록 꾸준히 재빌드 촉진, 실행 중인 코드 디버깅 수행, 라이브 애플리케이션에서 로그 스트리밍을 쉽게 확인할 수 있습니다.
Cloud Code에는 빠른 시작을 위한 코드 샘플 템플릿 모음이 포함되어 있습니다. 기존 샘플을 사용하여 새 애플리케이션을 만들려면 다음 단계를 따르세요.
IDE에서 File(파일) > New Project(새 프로젝트)를 열고 Cloud Code: Kubernetes를 선택합니다.
시작 애플리케이션 목록에서 Hello World 템플릿을 선택합니다.
프로젝트 이름을 선택합니다.
마침을 클릭하면 Cloud Code에서 선택한 템플릿을 클론하여 사용할 새로 만든 프로젝트를 엽니다.
자바 템플릿의 경우 필요한 Maven 프로젝트를 가져와서 pom.xml을 동기화하라는 메시지가 표시됩니다. Add as Maven project(Maven 프로젝트로 추가)를 클릭한 다음 Import Changes(변경사항 가져오기)를 클릭합니다.
클러스터 선택
애플리케이션을 개발하려면 Minikube에서 로컬로 호스팅되거나 Google Kubernetes Engine 클러스터와 같은 클라우드 플랫폼을 사용하는 연결된 Kubernetes 클러스터가 필요합니다.
로컬 클러스터
이 빠른 시작에서 사용할 클러스터가 없는 경우 Cloud Code 관리형 로컬 Minikube 클러스터로 애플리케이션을 실행할 수 있습니다.
Cloud Code는 애플리케이션 실행을 위해 Minikube 클러스터를 시작하고, 배포가 중지되면 클러스터를 중지합니다. Minikube 클러스터가 이미 실행 중인 경우, Cloud Code는 배포를 위해 기존 Minikube 클러스터를 재사용합니다.
다음 단계인 애플리케이션 개발에서 배포 환경설정으로 설정하여 이 Cloud Code 관리형 Minikube 클러스터를 사용할 수 있습니다.
클라우드 플랫폼 기반 클러스터
kubectl과 같이 이 빠른 시작에 사용할 수 있는 Kubernetes 도구를 사용하도록 구성된 클러스터가 이미 있으면 Cloud Code가 이를 자동으로 배포합니다. 애플리케이션 개발로 이동하여 원하는 클러스터가 현재 컨텍스트로 설정되었는지 확인할 수 있습니다.
그렇지 않으면 해당 클라우드 플랫폼의 특정 안내에 따라 만들 수 있습니다. GKE의 경우 클러스터 만들기 가이드를 따를 수 있습니다.
애플리케이션 개발
Kubernetes에서 애플리케이션 개발을 시작하려면 다음 안내를 따릅니다.
Cloud Platform에서 호스팅된 클러스터에서 실행 중인 경우 Kubernetes에서 개발에 대한 컨테이너 이미지가 저장되는 위치를 정의했는지 확인합니다.
IDE에서 Google Cloud 에 로그인하고 기본 프로젝트가 정의된 경우 Cloud Code는 자동으로 기본 컨테이너 이미지 저장소({project_id}가 기본 프로젝트를 참조하는 경우 gcr.io/{project_id})를 사용합니다.
원하는 Kubernetes 컨텍스트가 설정되었는지 확인합니다. 이는 실행 탭 및 배포 환경설정 섹션에 있는 Develop on Kubernetes 구성에서 지정할 수 있습니다(실행 > 구성 수정 > Develop on Kubernetes를 통해 액세스 가능).
현재 컨텍스트(기본값), Minikube 클러스터에 로컬로, 또는 사용 가능한 다른 컨텍스트에 배포하도록 선택할 수 있습니다.
기본적으로 Kubernetes 애플리케이션은 주문형으로 선택된 주문형 모드에서 실행됩니다. 원하는 경우 파일 저장 시 옵션을 대신 선택할 수 있습니다.
탐색 메뉴의 실행/디버그 구성 선택기에서 Kubernetes에서 개발 실행 대상을 선택합니다.
이렇게 하면 모든 코드 변경사항이 자동으로 새 버전의 애플리케이션에 빌드, 푸시, 배포됩니다.
Kubernetes 클러스터에서 개발 주기를 시작하려면 Kubernetes에서 개발
출력 창의 로그 탭에서 수신되는 애플리케이션 로그를 확인합니다.
배포가 시작되면 배포된 애플리케이션에 전달된 포트 목록이 표시됩니다.
배포가 성공하면 새로운 서비스 URL을 사용할 수 있다는 알림이 표시됩니다. 서비스 URL 탭을 클릭하여 URL을 확인한 후 URL 링크를 클릭하여 실행 중인 애플리케이션으로 브라우저를 엽니다.
또는 이벤트 로그를 연 후 링크를 클릭하여 실행 중인 애플리케이션으로 브라우저를 열 수 있습니다.
[[["이해하기 쉬움","easyToUnderstand","thumb-up"],["문제가 해결됨","solvedMyProblem","thumb-up"],["기타","otherUp","thumb-up"]],[["이해하기 어려움","hardToUnderstand","thumb-down"],["잘못된 정보 또는 샘플 코드","incorrectInformationOrSampleCode","thumb-down"],["필요한 정보/샘플이 없음","missingTheInformationSamplesINeed","thumb-down"],["번역 문제","translationIssue","thumb-down"],["기타","otherDown","thumb-down"]],["최종 업데이트: 2025-09-05(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)."]]