Use an existing application in Cloud Code for VS Code
Stay organized with collectionsSave and categorize content based on your preferences.
Cloud Code leveragesSkaffoldunder the hood to run
or debug your application.
If you have an existing application already configured with Kubernetes manifests and a
Dockerfile to build your images, you can open and use it with Cloud Code.
The only additional configuration necessary is askaffold configurationand alaunch configurationof typecloudcode.kubernetes. Cloud Code guides you through creating these
when you run or debug your application for the first time.
Setting up configuration
If your application has a Dockerfile but doesn't have the necessary Skaffold and
launch configurations, complete the following steps:
In the Cloud Code status bar, click the active project name.
In the Quick Pick menu that appears, selectRun on KubernetesorDebug
on Kubernetes.
In the Run/Debug on Kubernetes dialog, specify your preferred builder
and its settings. You can also customize your configuration name.
The newly createdskaffold.yamlandcloudcode.kuberneteslaunch configuration are added to your workspace and
your apprunsor is ready fordebugging.
Setting up configuration for applications that already have skaffold.yaml
If your application already has askaffold.yamlfile, follow these steps:
In the Cloud Code status bar, click the active project name.
In the Quick Pick menu that appears, selectRun on KubernetesorDebug
on Kubernetes.
If more than oneskaffold.yamlfile exists in your workspace, select your
preferred skaffold.yaml file.
If more than oneSkaffold profileexists in
theskaffold.yamlfile you chose, select your preferred Skaffold profile.
The newly createdcloudcode.kuberneteslaunch configuration is added to
your workspace (in .vscode/launch.json) and your app isrunningor ready fordebugging.
Manually creating a Skaffold configuration
You might want to manually create your Skaffold configuration to define custom
options. Cloud Code comes with live templating to support manual
Skaffold configuration creation.
To manually create a Skaffold configuration:
Create a new file namedskaffold.yamlin the root directory of your
workspace.
In the file, pressCommand/Ctrl+Spaceto see a list of snippet suggestions
and then select theSkaffold - Getting-startedsnippet.
Enter your project image name in theimagefield and enter a list of the
Kubernetes resources to deploy in themanifestsfield.
If you'd like to define build, test and deployment configurations for
different contexts, you can have different Skaffold profiles. The following
sample shows a Cloud Build profile to configure Cloud Code to
build images with Cloud Build:
profiles:
# use the cloudbuild profile to build images using Google Cloud Build
- name: cloudbuild
build:
googleCloudBuild: {}
[[["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-09-04 UTC."],[[["\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\u003eIf your application lacks Skaffold and launch configurations, Cloud Code guides you through creating them when you first run or debug, including setting up a \u003ccode\u003eskaffold.yaml\u003c/code\u003e and \u003ccode\u003ecloudcode.kubernetes\u003c/code\u003e launch configuration automatically.\u003c/p\u003e\n"],["\u003cp\u003eFor applications already possessing a \u003ccode\u003eskaffold.yaml\u003c/code\u003e, Cloud Code streamlines the process by allowing you to select the desired \u003ccode\u003eskaffold.yaml\u003c/code\u003e file and Skaffold profile, creating a \u003ccode\u003ecloudcode.kubernetes\u003c/code\u003e launch configuration automatically.\u003c/p\u003e\n"],["\u003cp\u003eYou can manually create a \u003ccode\u003eskaffold.yaml\u003c/code\u003e configuration, leveraging Cloud Code's live templating feature and snippet suggestions to define custom options, build, test, and deployment configurations, with options to include multiple Skaffold profiles.\u003c/p\u003e\n"],["\u003cp\u003eAfter the configurations are set, file sync and hot reloading can be used to speed up development and debugging.\u003c/p\u003e\n"]]],[],null,["# Use an existing application in Cloud Code for VS Code\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\n5. If prompted, [authenticate your credentials to run and debug an\n application locally](/code/docs/vscode/install#authenticate_credentials_for_debugging_applications_locally).\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/vscode/run-application) or is ready for [debugging](/code/docs/vscode/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/vscode/run-application) or ready for [debugging](/code/docs/vscode/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/vscode/speed-up-k8s-development#enable-skaffold-file-sync-and-hot-reloading) to speed up development.\n- [Debug your application in Cloud Code](/code/docs/vscode/debug).\n\nGet Support\n-----------\n\nTo send feedback, report issues on [GitHub](https://github.com/GoogleCloudPlatform/cloud-code-vscode/issues), or ask a question on [Stack Overflow](https://stackoverflow.com/questions/ask?tags=cloud-code-vscode)."]]