애플리케이션을 설정하면 Kubernetes 클러스터에서 실행하고 skaffold dev를 사용하여 실시간으로 볼 수 있습니다.
Minikube 또는 Docker Desktop과 같은 로컬 클러스터, Google Kubernetes Engine 또는 다른 클라우드 제공업체에서 애플리케이션을 실행할 수 있습니다.
원하는 실행 작업에서 실행 아이콘을 클릭합니다. 그런 다음 로그 탭의 출력 창에서 수신되는 애플리케이션 로그를 볼 수 있습니다.
배포가 시작되면 배포된 애플리케이션의 전달된 포트 목록이 표시됩니다.
배포가 성공하면 새로운 서비스 URL을 사용할 수 있다는 알림이 표시됩니다. 서비스 URL 탭을 클릭하여 URL을 확인한 후 URL 링크를 클릭하여 실행 중인 애플리케이션으로 브라우저를 엽니다.
또는 이벤트 로그를 연 후 링크를 클릭하여 실행 중인 애플리케이션으로 브라우저를 열 수 있습니다.
배포된 리소스 창에는 개발 세션 중에 배포한 항목이 표시됩니다.
로그 보기
애플리케이션을 개발하고 실행하는 동안 터미널 출력에서 pod를 실시간 스트림으로 보는 로그 외에 Kubernetes 탐색기로 이동하여 특정 pod의 로그를 볼 수 있습니다.
특정 포드의 로그를 보려면 다음 단계를 따릅니다.
Kubernetes 탐색기로 이동합니다. 오른쪽 측면 패널에서 또는 Tools(도구) > Cloud Code > Kubernetes > View Cluster Explorer(클러스터 탐색기 보기)를 사용해 액세스할 수 있습니다.
로그를 보려는 포드를 선택합니다.
pod를 마우스 오른쪽 버튼으로 클릭한 다음 스트림 로그를 클릭합니다. 또는 pod에서 실행되는 개별 컨테이너의 로그를 스트리밍할 수 있습니다.
Kubernetes 탐색기 콘솔에 로그가 표시됩니다.
변경, 다시 빌드, 삭제
시작 구성에서 감시 모드가 주문형으로 설정되어 있고 애플리케이션을 변경한 후 애플리케이션을 다시 빌드하고 다시 배포하려는 경우:
변경사항을 적용하고 저장합니다.
빌드 및 배포 트리거 아이콘을 클릭하거나 Option + Ctrl/Cmd + Comma를 눌러 애플리케이션을 다시 빌드하고 다시 배포합니다.
애플리케이션을 중지한 후 배포된 모든 Kubernetes 리소스가 클러스터에서 삭제됩니다. 시작 구성에서 cleanUp 플래그를 사용하여 이 동작을 변경할 수 있습니다.
보안 비밀 저장
코드에 API 키, 비밀번호, 인증서와 같이 민감할 수 있는 데이터가 포함된 경우 이를 보안 비밀로 저장하는 것이 좋습니다. Cloud Code를 사용하면 이러한 보안 비밀을 Secret Manager에 안전하게 저장하고 필요할 때 프로그래매틱 방식으로 가져올 수 있습니다.
Cloud Code를 사용하여 보안 비밀을 만들고 관리하는 방법에 대한 자세한 내용은 Secret Manager 가이드를 참조하세요.
리소스 세부정보 보기
Kubernetes 탐색기에는 클러스터, 네임스페이스, 노드, 워크로드(예: 배포, 복제본, 포드, 컨테이너 등), 서비스 및 인그레스, 구성(보안 비밀, 구성 맵 등), 스토리지(볼륨 등)가 표시됩니다.
Kubernetes 탐색기를 사용하면 이러한 리소스 중 일부에 대해 고유한 작업을 수행할 수 있습니다.
[[["이해하기 쉬움","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-04(UTC)"],[[["\u003cp\u003eCloud Code facilitates the creation of Kubernetes applications from either provided templates or existing projects, offering a streamlined development experience.\u003c/p\u003e\n"],["\u003cp\u003eUsers can easily run and develop applications on Kubernetes clusters, with automated run targets and options for manual configuration through the IDE.\u003c/p\u003e\n"],["\u003cp\u003eCloud Code supports various container image build methods, including Docker, Jib, and Buildpacks, with customizable settings available for each.\u003c/p\u003e\n"],["\u003cp\u003eThe platform provides tools for viewing logs, managing resources, and making iterative changes with features like file syncing and hot reloading for efficient development.\u003c/p\u003e\n"],["\u003cp\u003eSensitive data can be securely managed using Cloud Code's integration with Secret Manager, and the Kubernetes Explorer offers a comprehensive view of cluster resources.\u003c/p\u003e\n"]]],[],null,["# Get started with Cloud Code for IntelliJ for Kubernetes\n\nCloud Code lets you create a Kubernetes application based on a\nsample or from an existing project.\n\nCreate an application from a template\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 Kubernetes application using\nan existing sample, follow these steps:\n\n\u003cbr /\u003e\n\n1. Open **File** \\\u003e **New Project**.\n2. Select **Cloud Code: Kubernetes**.\n3. Select a template from the list of starter applications.\n4. Pick a name for your project.\n\n Once you click **Finish**, Cloud Code will clone your chosen\n template and open your newly created project for use.\n\n For **Java** templates, you'll be prompted to import Maven projects\n to sync your pom.xml. Click **Add as Maven project** . Additionally, import\n necessary Maven projects by clicking **Import Changes**.\n5. Kubernetes run and development IDE run targets for the project are\n automatically created and ready to run.\n\n Optional: Alternatively, you can\n manually create run targets:\n 1. Select the **Run Configuration** drop down, and click **Edit Configurations**.\n 2. Click **+ Add New Configuration** to add a new run configuration.\n 3. Navigate to **Cloud Code: Kubernetes**\n 4. Enter a name for your new configuration (default is \"Unnamed\").\n 5. Click **OK** to create your run target.\n\n | **Note:** If you're logged into Google Cloud in your IDE and you have a default project defined, Cloud Code uses your default container image repository. To specify a different container image, follow [Configuring\n | container image settings](/code/docs/intellij/configuring-container-image-settings#specifying_where_container_images_are_stored).\n\nUse your own application\n------------------------\n\nFor steps to use an existing project, see\n[use Cloud Code with an existing Kubernetes application](/code/docs/intellij/use-existing-app).\n| **Note:** For developing and testing an app, create and run the application on a non-production cluster. \n| For changes that will be rolled out to production, use an [automated CI/CD workflow](/docs/ci-cd).\n\nSet your Kubernetes context\n---------------------------\n\nBefore running your application, ensure you're set up to deploy your app to\nyour preferred Kubernetes context. You can specify this in your\n[configuration](#configuration).\n\nIf you'd like to switch your current context, you can do so with the\n[Kubernetes Explorer](/code/docs/intellij/use-kubernetes-explorer#clusters),\naccessible either from its sidebar panel on the right or\nusing **Tools** \\\u003e **Cloud Code** \\\u003e **Kubernetes** \\\u003e **View Cluster Explorer**.\n\nTo optimize your development loop by quickly picking up file changes of a\ncertain type without having to perform an image rebuild, you can\n[enable file syncing and hot reloading](/code/docs/intellij/yaml-editing#enabling_skaffold_file_sync_and_hot_reloading).\n\n\nConfiguration\n-------------\n\nWhen using the **Cloud Code: Develop on Kubernetes** run configuration, you can\ncustomize your deployment by configuring available settings.\nTo add or edit configurations, go to **Run** \\\u003e **Edit Configurations** .\n\n\u003cbr /\u003e\n\nContainer image storage options\n-------------------------------\n\nIf you chose a remote cluster as the context, choose an image registry to push\nthe images to. Go to **Run** \\\u003e **Edit configurations** to set the image registry\nin your **Run/Debug Configurations**.\n\nRefer to the\n[guide on storing your container image](/code/docs/intellij/configuring-container-image-settings)\nfor more details.\n\nBuild settings\n--------------\n\nCloud Code supports Docker, Jib, and Buildpacks artifact types.\nRefer to the [Configuring container image build preferences guide](/code/docs/intellij/image-build-settings)\nto learn about how to set your preferred builder and its relevant settings.\n\nCustomize your launch configuration\n-----------------------------------\n\nTo configure how your application is run, you can customize your\n[`skaffold.yaml`](https://skaffold.dev/docs/references/yaml) file.\n\nYou can also configure your launch in your **Run/Debug configurations** . To edit\nyour configurations, go to **Run** \\\u003e **Edit configurations**.\n\nFor more information on customizing your launch configuration, see the\n[Kubernetes in Cloud Code](/code/docs/intellij/k8s-overview#customize_your_launch_configuration).\n| **Note:** Cloud Code is built to work with [Cloud Build](/build/docs). To build an existing application using Google Cloud infrastructure, see the [Skaffold docs for Cloud Build](https://skaffold.dev/docs/pipeline-stages/builders/docker/#dockerfile-remotely-with-google-cloud-build).\n\nRun your application\n--------------------\n\nOnce you have an application set up, you can run it on a Kubernetes cluster and\nview it live, by leveraging\n[`skaffold dev`](https://skaffold.dev/docs/workflows/dev).\nYou can run your application on a local cluster (like minikube or Docker\nDesktop), Google Kubernetes Engine, or any other Cloud provider.\n| **Note:** If you're working with a private Autopilot cluster, you might run into an image pull error when pulling an image outside of the image registry for your project, such as by using Docker Hub. To resolve this issue, you can either host the image on [Artifact Registry](/artifact-registry/docs/docker/pushing-and-pulling) or provide [outbound internet access for your private nodes](/nat/docs/gke-example#create-nat).\n\n1. Click the Run icon on your preferred run action. You can then view incoming\n application logs in the **output window** under the **Logs** tab.\n\n When the deployment starts, you'll see the list of forwarded ports for your\n deployed application.\n2. After 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\nView logs\n---------\n\nIn addition to seeing logs from running pods as a live stream 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 click **Stream Logs**. Alternatively, you can\n stream logs for individual containers running in pods.\n\n The Kubernetes Explorer Console displays the logs.\n\nMake changes, rebuild, and clean up\n-----------------------------------\n\nIf watch mode is set to **On demand** in your launch configuration and you want to make changes to your application and then rebuild and redeploy the application:\n\n\u003cbr /\u003e\n\n1. Make and save your changes.\n\n2. Click the **Trigger Build and Deploy** icon or press\n `Option + Ctrl/Cmd + Comma` to rebuild and redeploy the application.\n\n3. To stop running the application, click the **Stop** icon or press\n `Ctrl/Cmd + F2`.\n\nAfter you stop the application, all deployed Kubernetes resources are\ndeleted from the cluster. You can change this behavior using the `cleanUp`\nflag in your launch configuration.\n\nStore secrets\n-------------\n\nIf your code includes potentially sensitive data like API keys, passwords, and\ncertificates, it is recommended you store them as secrets. With\nCloud Code, you can securely store these secrets in\nSecret Manager and programmatically fetch them when you need them.\n\nFor a detailed look at how you can create and manage secrets with\nCloud Code, see the\n[Secret Manager guide](/code/docs/intellij/secret-manager).\n\nView resource details\n---------------------\n\nThe Kubernetes Explorer displays clusters, namespaces, nodes, workloads\n(such as deployments, replicasets, pods and containers), services and ingresses,\nconfigurations (such as secrets and config maps) and storage (such as volumes).\nUsing the Kubernetes Explorer, you can perform unique actions on some\nof these resources.\n\nSee the [Kubernetes overview](/code/docs/intellij/k8s-overview#resource-specific_actions) for more\ninformation on viewing resource details.\n\nWhat's next\n-----------\n\n- [Explore your build options with buildpacks, Jib, or Docker](/code/docs/intellij/image-build-settings).\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- Learn more about Cloud Code's [YAML editing](/code/docs/intellij/yaml-editing) assistance.\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)."]]