Cloud Code leverages Skaffold under 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 a skaffold configuration
and a launch configuration
of type cloudcode.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, select Run on Kubernetesor Debug on Kubernetes.
-
In the Run/Debug on Kubernetes dialog, specify your preferred builder and its settings. You can also customize your configuration name.
-
Click Debugor Run.
-
If prompted, authenticate your credentials to run and debug an application locally .
The newly created
skaffold.yamlandcloudcode.kuberneteslaunch configuration are added to your workspace and your app runs or is ready for debugging .
Setting up configuration for applications that already have skaffold.yaml
If your application already has a skaffold.yaml
file, follow these steps:
-
In the Cloud Code status bar, click the active project name.

-
In the Quick Pick menu that appears, select Run on Kubernetesor Debug on Kubernetes.
-
If more than one
skaffold.yamlfile exists in your workspace, select your preferred skaffold.yaml file. -
If more than one Skaffold profile exists in the
skaffold.yamlfile you chose, select your preferred Skaffold profile.The newly created
cloudcode.kuberneteslaunch configuration is added to your workspace (in .vscode/launch.json) and your app is running or ready for debugging .
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 named
skaffold.yamlin the root directory of your workspace. -
In the file, press
Command/Ctrl+Spaceto see a list of snippet suggestions and then select the Skaffold - Getting-startedsnippet.
-
Enter your project image name in the
imagefield and enter a list of the Kubernetes resources to deploy in themanifestsfield.Example for Dockerfile based builds:
build : artifacts : - image : image_name deploy : kubectl : manifests : - k8s / web . yaml - k8s / backend . yamlIf 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: {}For comprehensive schema details, see the skaffold.yaml reference .
What's next
- Use file sync and hot reloading to speed up development.
- Debug your application in Cloud Code .

