[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["很难理解","hardToUnderstand","thumb-down"],["信息或示例代码不正确","incorrectInformationOrSampleCode","thumb-down"],["没有我需要的信息/示例","missingTheInformationSamplesINeed","thumb-down"],["翻译问题","translationIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2025-08-11。"],[[["\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)."]]