Configura la configuración de Cloud Code para VS Code
Organiza tus páginas con colecciones
Guarda y categoriza el contenido según tus preferencias.
Puedes personalizar Cloud Code para habilitar la finalización de recursos del clúster, habilitar el formato y la validación de YAML, mostrar o ocultar exploradores, recopilar telemetría y personalizar tu ruta de Kubeconfig.
Especifica las preferencias en el menú “Configuración” de VS Code
Para configurar la configuración de VS Code, haz clic en ConfiguraciónAdministrar > Configuración y, luego, busca cloudcode.
Configurar las preferencias de esta manera te permite cambiar las opciones predeterminadas que guardó Cloud Code cuando se te solicitaron por primera vez.
Esta configuración incluye preferencias para el formato y la finalización de YAML, la recopilación de métricas, la ruta de acceso al archivo KubeConfig, el estilo de unión y los criterios de coincidencia de archivos YAML. Se pueden definir otras opciones de configuración de Cloud Code en el archivo settings.json.
Cómo trabajar con archivos KubeConfig adicionales
Un archivo KubeConfig es un archivo que Kubernetes usa para configurar el acceso a los clústeres. De forma predeterminada,
Cloud Code usa el archivo KubeConfig predeterminado (ubicado en el
directorio $HOME/.kube) para recuperar los recursos de Kubernetes y ejecutar
los comandos.
Importa un KubeConfig nuevo
Para importar un archivo KubeConfig alternativo a Cloud Code, sigue estos pasos:
Haz clic en Cloud Code y, luego, expande la sección
Kubernetes.
Coloca el puntero sobre el nombre de la configuración predeterminada.
Haz clic en
sync_altSwitch KubeConfig junto a la configuración predeterminada y, luego, haz clic en
+ Load KubeConfig.
En el explorador de archivos, selecciona el KubeConfig que deseas importar. El archivo que importaste se convierte en el archivo KubeConfig activo.
Sugerencia: Si importaste varios archivos KubeConfig, puedes cambiar entre ellos fácilmente haciendo clic en sync_altSwitch KubeConfig y, luego, seleccionando otro archivo KubeConfig.
Cómo quitar un KubeConfig
Para quitar los archivos KubeConfig que importaste, abre la paleta de comandos
(presiona Ctrl/Cmd+Shift+P o haz clic en Ver > Paleta de comandos), ejecuta
el comando Remove KubeConfig from Kubernetes Explorer y, luego, selecciona las
parámetros de configuración que deseas quitar.
Configura la configuración en settings.json
Algunos parámetros de configuración avanzados, como las personalizaciones del depurador de Cloud Code, se configuran en el archivo settings.json.
En Configuración, haz clic en Editar en settings.json debajo del parámetro de configuración que quieras cambiar. El archivo settings.json se abrirá en la configuración adecuada.
Escribe comillas (") para abrir la lista de propiedades o valores del parámetro de configuración. Por ejemplo, escribir " en cloudcode.debug-kubernetes muestra las opciones de SuppressGoWarning, SuppressJavaWarning, SuppressNETCoreWarning, SuppressNodeJSWarning y SuppressPythonWarning.
Haz clic en la propiedad y, luego, en el valor que deseas que tenga, o bien, si el parámetro de configuración toma un valor directamente, haz clic en el valor. Por ejemplo, hacer clic en SuppressNodeJSWarning muestra las opciones true y false.
Obtener asistencia
Para enviar comentarios, informa problemas en GitHub o haz preguntas en Stack Overflow.
[[["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\u003eCloud Code preferences can be customized within VS Code Settings to manage YAML formatting, telemetry collection, KubeConfig path, and more.\u003c/p\u003e\n"],["\u003cp\u003eCloud Code utilizes KubeConfig files to access Kubernetes clusters, with the default being \u003ccode\u003e$HOME/.kube\u003c/code\u003e, but alternative files can be imported.\u003c/p\u003e\n"],["\u003cp\u003eYou can easily switch between multiple imported KubeConfig files using the "Switch KubeConfig" option within the Cloud Code Kubernetes section.\u003c/p\u003e\n"],["\u003cp\u003eThe KubeConfig files you've imported can be removed through the command palette using the "Remove KubeConfig from Kubernetes Explorer" command.\u003c/p\u003e\n"],["\u003cp\u003eAdvanced settings, such as Cloud Code debugger customizations, are configured directly within the \u003ccode\u003esettings.json\u003c/code\u003e file, offering detailed control over various functionalities.\u003c/p\u003e\n"]]],[],null,["# Configure Cloud Code for VS Code settings\n\nYou can customize Cloud Code to enable cluster resource\ncompletion, enable YAML formatting and validation, display or hide explorers,\ncollect telemetry, and customize your Kubeconfig path.\n\nSpecifying preferences using VS Code Settings\n---------------------------------------------\n\nTo configure VS Code Settings, click\nsettings\n**Manage** \\\u003e **Settings** and then search for `cloudcode`.\n\nConfiguring preferences this way lets you change the defaults that\nCloud Code saved when you were first prompted for preferences.\nThese settings include preferences for YAML formatting and completion,\ntelemetry collection, the KubeConfig file path, wrapping style, and criteria for\nYAML file matching. Other Cloud Code settings are configurable\nusing your `settings.json` file.\n\nWorking with additional KubeConfig files\n----------------------------------------\n\nA [KubeConfig file](https://kubernetes.io/docs/concepts/configuration/organize-cluster-access-kubeconfig/)\nis a file that Kubernetes uses to configure access to clusters. By default,\nCloud Code uses the default KubeConfig file (located in the\n`$HOME/.kube` directory) for retrieving Kubernetes resources and running\ncommands.\n\n### Importing a new KubeConfig\n\nTo import an alternative KubeConfig file into Cloud Code,\nfollow these steps:\n\n1. Click **Cloud Code** and then expand the **Kubernetes** section.\n2. Hold the pointer over the default config name.\n3. Click sync_alt **Switch KubeConfig** next to the Default Config and then click **+ Load KubeConfig**.\n4. In the file explorer, select the KubeConfig that you want to import. The file you imported becomes the active KubeConfig file.\n\n**Tip:** If you've imported multiple KubeConfig files, you can easily switch\nbetween them by clicking\nsync_alt\n**Switch KubeConfig** and then selecting another KubeConfig file.\n\n### Removing a KubeConfig\n\nTo remove the KubeConfig file(s) that you've imported, open the command palette\n(press `Ctrl`/`Cmd`+`Shift`+`P` or click **View** \\\u003e **Command Palette** ), run\nthe **Remove KubeConfig from Kubernetes Explorer** command, and then select the\nconfigs that you want to remove.\n\nConfiguring settings in `settings.json`\n---------------------------------------\n\nSome advanced settings, like Cloud Code debugger customizations,\nare configured in the `settings.json` file.\n\n1. In Settings, click **Edit in settings.json** under the setting that you want to change. The `settings.json` file opens at the appropriate setting.\n2. Type a quotation mark (\") to open the list of properties or values for the setting. For example, typing \" in `cloudcode.debug-kubernetes` gives the options of `SuppressGoWarning`, `SuppressJavaWarning`, `SuppressNETCoreWarning`, `SuppressNodeJSWarning`, and `SuppressPythonWarning`.\n3. Click the property and then click the value you want the property to have, or, if the setting takes a value directly, click the value. For example, clicking `SuppressNodeJSWarning` gives the options of `true` and `false`.\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)."]]