[[["易于理解","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-09-04。"],[[["\u003cp\u003eCloud Code utilizes Skaffold for running and debugging applications, and it can be used with existing applications that are already configured with Kubernetes manifests and a Dockerfile.\u003c/p\u003e\n"],["\u003cp\u003eCloud Code guides users through the creation of the necessary \u003ccode\u003eskaffold.yaml\u003c/code\u003e and \u003ccode\u003ecloudcode.kubernetes\u003c/code\u003e launch configurations when running or debugging an application for the first time if they don't already exist.\u003c/p\u003e\n"],["\u003cp\u003eIf your application already has a \u003ccode\u003eskaffold.yaml\u003c/code\u003e file, Cloud Code allows you to select the file and profile to use when running or debugging.\u003c/p\u003e\n"],["\u003cp\u003eUsers can manually create a \u003ccode\u003eskaffold.yaml\u003c/code\u003e file for custom options, with Cloud Code offering live templating and snippet suggestions to aid in the configuration process.\u003c/p\u003e\n"],["\u003cp\u003eAfter configuration, users can leverage features like file sync and hot reloading to accelerate development and debug their applications directly within Cloud Code.\u003c/p\u003e\n"]]],[],null,["# Use an existing application in Cloud Code for Cloud Shell\n\nCloud Code leverages [Skaffold](/skaffold) under the hood to run\nor debug your application.\n\nIf you have an existing application already configured with Kubernetes manifests and a\nDockerfile to build your images, you can open and use it with Cloud Code.\n\nThe only additional configuration necessary is a [skaffold configuration](https://skaffold.dev/docs/references/yaml/)\nand a [launch configuration](https://code.visualstudio.com/docs/editor/debugging#_launch-configurations)\nof type `cloudcode.kubernetes`. Cloud Code guides you through creating these\nwhen you run or debug your application for the first time.\n\nSetting up configuration\n------------------------\n\n| **Note:** Automatic `skaffold.yaml` generation doesn't support projects without a Dockerfile. For these projects, [create a skaffold.yaml file manually](#manually_creating_a_skaffold_configuration).\n\nIf your application has a Dockerfile but doesn't have the necessary Skaffold and\nlaunch configurations, complete the following steps:\n\n1. In the Cloud Code status bar, click the active project name.\n\n2. In the Quick Pick menu that appears, select **Run on Kubernetes** or **Debug\n on Kubernetes**.\n\n3. In the Run/Debug on Kubernetes dialog, specify your preferred builder\n and its settings. You can also customize your configuration name.\n\n4. Click **Debug** or **Run**.\n\n The newly created `skaffold.yaml` and\n `cloudcode.kubernetes` launch configuration are added to your workspace and\n your app [runs](/code/docs/shell/run-application) or is ready for [debugging](/code/docs/shell/debug).\n\nSetting up configuration for applications that already have skaffold.yaml\n-------------------------------------------------------------------------\n\nIf your application already has a `skaffold.yaml` file, follow these steps:\n\n1. In the Cloud Code status bar, click the active project name.\n\n2. In the Quick Pick menu that appears, select **Run on Kubernetes** or **Debug\n on Kubernetes**.\n\n3. If more than one `skaffold.yaml` file exists in your workspace, select your\n preferred skaffold.yaml file.\n\n4. If more than one\n [Skaffold profile](https://skaffold.dev/docs/environment/profiles/) exists in\n the `skaffold.yaml` file you chose, select your preferred Skaffold profile.\n\n The newly created `cloudcode.kubernetes` launch configuration is added to\n your workspace (in .vscode/launch.json) and your app is\n [running](/code/docs/shell/run-application) or ready for [debugging](/code/docs/shell/debug).\n\nManually creating a Skaffold configuration\n------------------------------------------\n\nYou might want to manually create your Skaffold configuration to define custom\noptions. Cloud Code comes with live templating to support manual\nSkaffold configuration creation.\n\nTo manually create a Skaffold configuration:\n\n1. Create a new file named `skaffold.yaml` in the root directory of your\n workspace.\n\n2. In the file, press `Command/Ctrl+Space` to see a list of snippet suggestions\n and then select the **Skaffold - Getting-started** snippet.\n\n3. Enter your project image name in the `image` field and enter a list of the\n Kubernetes resources to deploy in the `manifests` field.\n\n Example for Dockerfile based builds: \n\n build:\n artifacts:\n - image: image_name\n deploy:\n kubectl:\n manifests:\n - k8s/web.yaml\n - k8s/backend.yaml\n\n If you'd like to define build, test and deployment configurations for\n different contexts, you can have different Skaffold profiles. The following\n sample shows a Cloud Build profile to configure Cloud Code to\n build images with Cloud Build: \n\n profiles:\n # use the cloudbuild profile to build images using Google Cloud Build\n - name: cloudbuild\n build:\n googleCloudBuild: {}\n\n For comprehensive schema details, see\n [the skaffold.yaml reference](https://skaffold.dev/docs/references/yaml).\n\nWhat's next\n-----------\n\n- Use [file sync and hot reloading](/code/docs/shell/speed-up-k8s-development#enable-skaffold-file-sync-and-hot-reloading) to speed up development.\n- [Debug your application in Cloud Code](/code/docs/shell/debug)."]]