Configuring Cloud Code settings

Most Cloud Code settings, such as enabling cluster resource completion, opting for YAML formatting and validation, and customizing your Kubeconfig path, can be configured using VS Code's Settings menu.

Specifying preferences using VS Code Settings

VS Code Settings is accessible through the Manage menu (Manage icon > Settings). Configuring preferences this way comes in handy when you'd like to override the defaults Cloud Code saved when you were first prompted for preferences.

You can use VS Code settings to toggle your preferences around YAML formatting and completion, explorer visibility, telemetry collection, and other Cloud Code options. You can also use it to define an alternate kubeconfig file path, determine a preferred style of prose wrapping, and define criteria for YAML file matching. Other Cloud Code settings are configurable using your settings.json file.

Working with additional kubeconfig files

By default, the Cloud Code extension uses the default kubeconfig file (located under the '$HOME/.kube' directory) for retrieving Kubernetes resources and running commands.

Importing a new kubeconfig

To import an alternate kubeconfig file into the extension, follow these steps:

  1. Navigate to the Cluster Explorer.
  2. Hover over the default config name.
  3. Click on 'Switch kubeconfig' using the double arrow button Switch kubeconfig icon next to the Default Config and select '+ Load kubeconfig…'. This will open up a file explorer.
  4. Select the kubeconfig that you want to import from the file explorer. This will switch the active kubeconfig file that the extension uses to the one you just imported.

Tip: If you've imported multiple kubeconfigs, you can easily switch between them by clicking on the 'Switch kubeconfig' button and selecting the kubeconfig you'd like to switch to.

Switching kubeconfigs and then removing a kubeconfig

Removing a kubeconfig

To remove the kubeconfig(s) that you've imported, you can run the 'Remove kubeconfig from Cluster Explorer' command and select as many configs as you'd like to remove.