Create an app with configuration dependencies
In this quickstart, you set up an application with configuration dependencies based on a sample application and then deploy parts of the app separately.
Before you begin
- Sign in to your Google Cloud account. If you're new to Google Cloud, create an account to evaluate how our products perform in real-world scenarios. New customers also get $300 in free credits to run, test, and deploy workloads.
-
In the Google Cloud console, on the project selector page, select or create a Google Cloud project.
-
Make sure that billing is enabled for your Google Cloud project.
-
Enable the Google Kubernetes Engine API.
-
In the Google Cloud console, on the project selector page, select or create a Google Cloud project.
-
Make sure that billing is enabled for your Google Cloud project.
-
Enable the Google Kubernetes Engine API.
- Install Git. Git is required for copying samples to your machine.
- Install the Cloud Code plugin if you haven't already.
Creating an application
Clone the Bank of Anthos repository:
- In the top menu bar, click Terminal > New Terminal.
Clone the Bank of Anthos repository:
git clone https://github.com/GoogleCloudPlatform/bank-of-anthos.git
To open the workspace based on Bank of Anthos, in VS Code, click File > Open folder and then navigate to the folder where the repository was cloned.
Double-click the
skaffold.yaml
file.The file contains multiple configurations, separated by YAML document separators (
---
). Each configuration can be deployed or referenced as a dependency separately.--- apiVersion: skaffold/v2beta18 kind: Config
Configurations with a name specified are known as Skaffold modules. The following excerpt defines the
frontend
module.metadata: name: frontend # module defining frontend service
Dependencies between configurations are specified using the
configs
tag. Required configurations must be deployed before the current configuration. The sample shows a dependency that's defined in the same file. Theconfigs
tag can also reference otherskaffold.yaml
files in the current project.requires: - configs: [db]
Deploying modules
- Open the Command Palette (
Ctrl
/Cmd
+Shift
+P
) and then run Cloud Code: Run on Kubernetes. - Click Select modules.
Choose the modules that you want to deploy and then click OK.
If you click db, the db config and the setup config that it requires are built.
When prompted, choose an image registry and then press
Enter
.
Cleaning up
After you terminate your application, all Kubernetes resources deployed during the run are deleted automatically.
To avoid incurring charges to your account for other resources used in this quickstart, be sure to delete the cluster and project you created.
If you're using Google Cloud and would like to delete just your cluster, you can do so by following these steps:
- Click Cloud Code and then expand the Kubernetes explorer.
- Hold the pointer over your cluster name and then click open_in_new Open in Google Cloud console.
- Click Delete and then click Delete.
To delete your project (and associated resources, including any clusters):
Go to the Projects page in the Google Cloud console:
Select the project that you created for this quickstart and then click Delete.
Type the project ID to confirm and then click Shut down.
This shuts down the project and schedules it for deletion.
What's next
- Learn more about Skaffold modules.
- Learn about the language-specific debugging support in Cloud Code.
- Customize your Cloud Code experience by configuring settings.