Organiza tus páginas con colecciones
Guarda y categoriza el contenido según tus preferencias.
Crea una app con dependencias de configuración
En esta guía de inicio rápido, configurarás una aplicación con dependencias de configuración basadas en una aplicación de muestra y, luego, implementarás partes de la app por separado.
Antes de comenzar
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.
Para abrir el espacio de trabajo basado en Bank of Anthos, en VS Code, haz clic en File > Open folder y, luego, navega a la carpeta en la que se clonó el repositorio.
Haz doble clic en el archivo skaffold.yaml.
El archivo contiene varias configuraciones, separadas por separadores de documentos YAML (---). Cada configuración se puede implementar o hacer referencia como una dependencia por separado.
---apiVersion:skaffold/v2beta18kind:Config
Las configuraciones con un nombre especificado se conocen como módulos de Skaffold.
En el siguiente fragmento, se define el módulo frontend.
metadata:name:frontend# module defining frontend service
Las dependencias entre las configuraciones se especifican con la etiqueta configs. Las configuraciones requeridas se deben implementar antes de la configuración actual. En el ejemplo, se muestra una dependencia que se define en el mismo archivo. La etiqueta configs también puede hacer referencia a otros archivos skaffold.yaml en el proyecto actual.
requires:-configs:[db]
Cómo implementar módulos
Abre la paleta de comandos (Ctrl/Cmd+Shift+P) y, luego, ejecuta Cloud Code: Run on Kubernetes.
Haz clic en Seleccionar módulos.
Elige los módulos que deseas implementar y, luego, haz clic en Aceptar.
Si haces clic en db, se compilarán la configuración de db y la configuración de setup que requiere.
Cuando se te solicite, elige un registro de imágenes y, luego, presiona Enter.
Realiza una limpieza
Después de detener la aplicación, todos los recursos de Kubernetes que implementaste durante la ejecución se borran de forma automática.
Para evitar que se apliquen cargos en tu cuenta por otros recursos que usaste en esta guía de inicio rápido, asegúrate de borrar el clúster y el proyecto que creaste.
Si usas Google Cloud y deseas borrar solo tu clúster, puedes hacerlo siguiendo estos pasos:
Haz clic en Cloud Code y, luego, expande el explorador de Kubernetes.
Mantén el puntero sobre el nombre de tu clúster y, luego, haz clic en
open_in_newAbrir en la Google Cloud consola.
Haz clic en Borrar y, luego, en Borrar.
Para borrar tu proyecto (y los recursos asociados, incluidos los clústeres), sigue estos pasos:
Ve a la página Proyectos en la Google Cloud consola:
[[["Fácil de comprender","easyToUnderstand","thumb-up"],["Resolvió mi problema","solvedMyProblem","thumb-up"],["Otro","otherUp","thumb-up"]],[["Difícil de entender","hardToUnderstand","thumb-down"],["Información o código de muestra incorrectos","incorrectInformationOrSampleCode","thumb-down"],["Faltan la información o los ejemplos que necesito","missingTheInformationSamplesINeed","thumb-down"],["Problema de traducción","translationIssue","thumb-down"],["Otro","otherDown","thumb-down"]],["Última actualización: 2025-09-04 (UTC)"],[[["\u003cp\u003eThis guide demonstrates how to set up an application with configuration dependencies and deploy parts of it separately using Skaffold modules.\u003c/p\u003e\n"],["\u003cp\u003eSkaffold modules, defined by a name within the \u003ccode\u003eskaffold.yaml\u003c/code\u003e file, allow for the separate deployment of configurations, including defining dependencies via the \u003ccode\u003econfigs\u003c/code\u003e tag.\u003c/p\u003e\n"],["\u003cp\u003eTo deploy selected modules, use the "Cloud Code: Run on Kubernetes" command in VS Code, and select the desired modules.\u003c/p\u003e\n"],["\u003cp\u003eThe guide highlights the cleanup process, including the automatic deletion of Kubernetes resources after application termination and instructions for manually deleting the cluster or project in Google Cloud.\u003c/p\u003e\n"],["\u003cp\u003eThe guide directs to further resources such as learning about Skaffold modules, language specific debugging, and configuring settings.\u003c/p\u003e\n"]]],[],null,["# Create an app with configuration dependencies\n=============================================\n\nIn this quickstart, you set up an application with configuration dependencies\nbased on a sample application and then deploy parts of the app separately.\n\nBefore you begin\n----------------\n\n- Sign in to your Google Cloud account. If you're new to Google Cloud, [create an account](https://console.cloud.google.com/freetrial) to evaluate how our products perform in real-world scenarios. New customers also get $300 in free credits to run, test, and deploy workloads.\n- In the Google Cloud console, on the project selector page,\n select or create a Google Cloud project.\n\n | **Note**: If you don't plan to keep the resources that you create in this procedure, create a project instead of selecting an existing project. After you finish these steps, you can delete the project, removing all resources associated with the project.\n\n [Go to project selector](https://console.cloud.google.com/projectselector2/home/dashboard)\n-\n [Verify that billing is enabled for your Google Cloud project](/billing/docs/how-to/verify-billing-enabled#confirm_billing_is_enabled_on_a_project).\n\n-\n\n\n Enable the Google Kubernetes Engine API.\n\n\n [Enable the API](https://console.cloud.google.com/flows/enableapi?apiid=container.googleapis.com)\n\n- In the Google Cloud console, on the project selector page,\n select or create a Google Cloud project.\n\n | **Note**: If you don't plan to keep the resources that you create in this procedure, create a project instead of selecting an existing project. After you finish these steps, you can delete the project, removing all resources associated with the project.\n\n [Go to project selector](https://console.cloud.google.com/projectselector2/home/dashboard)\n-\n [Verify that billing is enabled for your Google Cloud project](/billing/docs/how-to/verify-billing-enabled#confirm_billing_is_enabled_on_a_project).\n\n-\n\n\n Enable the Google Kubernetes Engine API.\n\n\n [Enable the API](https://console.cloud.google.com/flows/enableapi?apiid=container.googleapis.com)\n\n1. Install [Git](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git). Git is required for copying samples to your machine.\n2. Install the [Cloud Code plugin](/code/docs/vscode/install#installing) if you haven't already.\n\nCreating an application\n-----------------------\n\n1. Clone the Bank of Anthos repository:\n\n 1. In the top menu bar, click **Terminal** \\\u003e **New Terminal**.\n 2. Clone the Bank of Anthos repository:\n\n git clone https://github.com/GoogleCloudPlatform/bank-of-anthos.git\n\n2. To open the workspace based on Bank of Anthos, in VS Code, click **File** \\\u003e\n **Open folder** and then navigate to the folder where the repository was\n cloned.\n\n3. Double-click the `skaffold.yaml` file.\n\n 1. The file contains multiple configurations, separated by YAML document\n separators (`---`). Each configuration can be deployed or referenced as a\n dependency separately.\n\n ---\n apiVersion: skaffold/v2beta18\n kind: Config\n\n 2. Configurations with a name specified are known as *Skaffold modules* .\n The following excerpt defines the `frontend` module.\n\n metadata:\n name: frontend # module defining frontend service\n\n 3. Dependencies between configurations are specified using the `configs`\n tag. Required configurations must be deployed before the current\n configuration. The sample shows a dependency that's defined in the same\n file. The `configs` tag can also reference other `skaffold.yaml` files in\n the current project.\n\n requires:\n - configs: [db]\n\nDeploying modules\n-----------------\n\n1. Open the Command Palette (`Ctrl`/`Cmd`+`Shift`+`P`) and then run **Cloud Code: Run on Kubernetes**.\n2. Click **Select modules**.\n3. Choose the modules that you want to deploy and then click **OK**.\n\n If you click **db** , the **db** config and the **setup** config that it\n requires are built.\n4. When prompted, choose an image registry and then press `Enter`.\n\nCleaning up\n-----------\n\nAfter you terminate your application, all Kubernetes resources deployed during\nthe run are deleted automatically.\n\nTo avoid incurring charges to your account for other resources used in this\nquickstart, be sure to delete the cluster and project you created.\n\nIf you're using Google Cloud and would like to delete just your cluster, you\ncan do so by following these steps:\n\n1. Click **Cloud Code** and then expand the **Kubernetes** explorer.\n2. Hold the pointer over your cluster name and then click open_in_new **Open in Google Cloud console**.\n3. Click **Delete** and then click **Delete**.\n\nTo delete your project (and associated resources, including any clusters):\n\n1. Go to the Projects page in the Google Cloud console:\n\n [Go to the Projects page](https://console.cloud.google.com/project)\n2. Select the project that you created for this quickstart and then click\n **Delete**.\n\n3. Type the project ID to confirm and then click **Shut down**.\n\n This shuts down the project and schedules it for deletion.\n\nWhat's next\n-----------\n\n- Learn more about [Skaffold modules](/code/docs/vscode/skaffold-modules).\n- Learn about the language-specific [debugging support](/code/docs/vscode/debug) in Cloud Code.\n- Customize your Cloud Code experience by configuring [settings](/code/docs/vscode/configuring-settings)."]]