Configurar o Cloud Code para as configurações do VS Code
Mantenha tudo organizado com as coleções
Salve e categorize o conteúdo com base nas suas preferências.
É possível personalizar o Cloud Code para ativar a conclusão de recursos do cluster, a formatação e a validação do YAML, mostrar ou ocultar exploradores, coletar telemetria e personalizar o caminho do Kubeconfig.
Como especificar preferências nas configurações do VS Code
Para definir as configurações do VS Code, clique em
ConfiguraçõesGerenciar > Configurações e pesquise cloudcode.
Configurar as preferências dessa maneira permite alterar os padrões que o Cloud Code salvou quando foi solicitado pela primeira vez.
Essas configurações incluem preferências para formatação e conclusão de YAML,
coleta de telemetria, caminho de arquivo do KubeConfig, estilo de quebra de linha e critérios para
correspondência de arquivos YAML. Outras configurações do Cloud Code são configuráveis
usando o arquivo settings.json.
Como trabalhar com outros arquivos KubeConfig
Um arquivo KubeConfig
é um arquivo que o Kubernetes usa para configurar o acesso a clusters. Por padrão, o Cloud Code usa o arquivo KubeConfig padrão (localizado no diretório $HOME/.kube) para recuperar recursos do Kubernetes e executar comandos.
Como importar um novo KubeConfig
Para importar um arquivo KubeConfig alternativo para o Cloud Code,
siga estas etapas:
Clique em Cloud Code e abra a seção Kubernetes.
Mantenha o cursor sobre o nome de configuração padrão.
Clique em
sync_altAlternar KubeConfig ao lado da configuração padrão e clique em
+ Carregar KubeConfig.
No explorador de arquivos, selecione o KubeConfig que você quer importar. O
arquivo importado se torna o KubeConfig ativo.
Dica:se você importou vários arquivos KubeConfig, é possível alternar
entre eles clicando em
sync_altAlternar KubeConfig e selecionando outro arquivo KubeConfig.
Como remover um KubeConfig
Para remover os arquivos KubeConfig importados, abra a paleta de comandos
(pressione Ctrl/Cmd+Shift+P ou clique em Visualizar > Paleta de comandos), execute
o comando Remove KubeConfig from Kubernetes Explorer e selecione as
configurações que você quer remover.
Como definir configurações em settings.json
Algumas configurações avançadas, como personalizações do depurador do Cloud Code,
são configuradas no arquivo settings.json.
Em "Configurações", clique em Editar em settings.json na configuração que você quer
mudar. O arquivo settings.json é aberto na configuração adequada.
Digite uma citação (") para abrir a lista de propriedades ou valores da
configuração. Por exemplo, digitar " em cloudcode.debug-kubernetes mostra as
opções SuppressGoWarning, SuppressJavaWarning,
SuppressNETCoreWarning, SuppressNodeJSWarning e
SuppressPythonWarning.
Clique na propriedade e no valor que você quer que ela tenha.
Se a configuração usar um valor diretamente, clique nele. Por exemplo,
ao clicar em SuppressNodeJSWarning, você tem as opções true e false.
Receber suporte
Acesse o GitHub para enviar feedback e informar problemas ou o Stack Overflow (ambos em inglês) para fazer perguntas.
[[["Fácil de entender","easyToUnderstand","thumb-up"],["Meu problema foi resolvido","solvedMyProblem","thumb-up"],["Outro","otherUp","thumb-up"]],[["Difícil de entender","hardToUnderstand","thumb-down"],["Informações incorretas ou exemplo de código","incorrectInformationOrSampleCode","thumb-down"],["Não contém as informações/amostras de que eu preciso","missingTheInformationSamplesINeed","thumb-down"],["Problema na tradução","translationIssue","thumb-down"],["Outro","otherDown","thumb-down"]],["Última atualização 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)."]]