Configura le impostazioni di Cloud Code per VS Code
Mantieni tutto organizzato con le raccolte
Salva e classifica i contenuti in base alle tue preferenze.
Puoi personalizzare Cloud Code per abilitare il completamento delle risorse del cluster, la formattazione e la convalida di YAML, visualizzare o nascondere gli esploratori, raccogliere la telemetria e personalizzare il percorso Kubeconfig.
Specificare le preferenze utilizzando le impostazioni di VS Code
Per configurare le impostazioni di VS Code, fai clic su ImpostazioniGestisci > Impostazioni e cerca cloudcode.
Configurare le preferenze in questo modo ti consente di modificare i valori predefiniti salvati da Cloud Code quando ti è stato chiesto per la prima volta di indicare le preferenze.
Queste impostazioni includono le preferenze per la formattazione e il completamento di YAML, la raccolta della telemetria, il percorso del file KubeConfig, lo stile di a capo e i criteri per la corrispondenza dei file YAML. Altre impostazioni di Cloud Code sono configurabili
utilizzando il file settings.json.
Utilizzo di file KubeConfig aggiuntivi
Un file KubeConfig è un file utilizzato da Kubernetes per configurare l'accesso ai cluster. Per impostazione predefinita, Cloud Code utilizza il file KubeConfig predefinito (nella directory $HOME/.kube) per recuperare le risorse Kubernetes ed eseguire i comandi.
Importazione di un nuovo file KubeConfig
Per importare un file KubeConfig alternativo in Cloud Code:
Fai clic su Cloud Code ed espandi la sezione Kubernetes.
Tieni il cursore sopra il nome della configurazione predefinita.
Fai clic su
sync_altCambia KubeConfig accanto a Configurazione predefinita, quindi fai clic su
+ Carica KubeConfig.
Nel file explorer, seleziona il file KubeConfig da importare. Il
file che hai importato diventa il file KubeConfig attivo.
Suggerimento:se hai importato più file KubeConfig, puoi passare facilmente da uno all'altro facendo clic su sync_altCambia KubeConfig e selezionando un altro file KubeConfig.
Rimozione di un file KubeConfig
Per rimuovere i file KubeConfig che hai importato, apri la tavolozza dei comandi
(premi Ctrl/Cmd+Shift+P o fai clic su Visualizza > Tavolozza comandi), esegui
il comando Rimuovi KubeConfig da Kubernetes Explorer e poi seleziona le configurazioni che vuoi rimuovere.
Configurare le impostazioni in settings.json
Alcune impostazioni avanzate, come le personalizzazioni del debugger Cloud Code,
vengono configurate nel file settings.json.
In Impostazioni, fai clic su Modifica in settings.json sotto l'impostazione che vuoi modificare. Il file settings.json si apre nell'impostazione appropriata.
Digita un apice (") per aprire l'elenco delle proprietà o dei valori per l'impostazione. Ad esempio, digitando " in cloudcode.debug-kubernetes vengono visualizzate le opzioni SuppressGoWarning, SuppressJavaWarning, SuppressNETCoreWarning, SuppressNodeJSWarning e SuppressPythonWarning.
Fai clic sulla proprietà e poi sul valore che vuoi che abbia la proprietà oppure, se l'impostazione accetta direttamente un valore, fai clic sul valore. Ad esempio,
se fai clic su SuppressNodeJSWarning, vengono visualizzate le opzioni true e false.
Richiedi assistenza
Per inviare feedback, segnala i problemi su
GitHub o fai una domanda su
Stack Overflow.
[[["Facile da capire","easyToUnderstand","thumb-up"],["Il problema è stato risolto","solvedMyProblem","thumb-up"],["Altra","otherUp","thumb-up"]],[["Difficile da capire","hardToUnderstand","thumb-down"],["Informazioni o codice di esempio errati","incorrectInformationOrSampleCode","thumb-down"],["Mancano le informazioni o gli esempi di cui ho bisogno","missingTheInformationSamplesINeed","thumb-down"],["Problema di traduzione","translationIssue","thumb-down"],["Altra","otherDown","thumb-down"]],["Ultimo aggiornamento 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)."]]