You can develop and debug parts of your application independently by splitting your application into Skaffold modules. For a sample Skaffold.yaml file with Skaffold modules and dependencies defined, see the Skaffold.yaml file in the Bank of Anthos sample.
Defining Skaffold modules and configuration dependencies
To define Skaffold modules and configuration dependencies:
- Install the latest Insiders builds.
- Open the project where you want to define the modules.
- Open the
- If your
skaffold.yamlfile has multiple configurations, to make a configuration a Skaffold module, specify the following line:
metadata: name: MODULE_NAME
- For configurations that rely on another configuration being deployed before the current
configuration can be deployed, define dependencies. To specify a dependency, use the
configstag. The following sample shows a dependency that's defined in the same file. The
configstag can also reference other skaffold.yaml files in the current project.
requires: - configs: [DEPENDENCY_NAME]
- Test your configuration dependencies by building each of the Skaffold modules separately to
make sure that they're deployed with their dependencies.
- Open the Command Palette
P) and then run Cloud Code: Run on Kubernetes.
- Click Select modules.
- Choose the modules that you want to deploy and then click OK. Each module is built with its dependencies.
- When prompted, choose an image registry and then press
- Open the Command Palette (
Building select Skaffold modules and their dependencies
If your project doesn't have a launch.yaml file defined, when you run Cloud Code: Run on Kubernetes or Cloud Code: Debug on Kubernetes, you're prompted to select the modules to build.
If your project has a launch.yaml file, follow these steps to choose the Skaffold modules to build:
- Open the terminal by clicking **Terminal** > **New Terminal**.
- Run the following command, where you specify the names of the modules to build as a
skaffold dev --module MODULE1_NAME,MODULE2_NAME