Work with kubeconfig files in Cloud Code for VS Code
Stay organized with collections
Save and categorize content based on your preferences.
kubeconfig files are Kubernetes configuration files that organize cluster
access, users, and contexts. This page shows you how to add, delete and switch
between different kubeconfigs in Cloud Code.
By default, the Cloud Code plugin uses the default kubeconfig file (located
under the $HOME/.kube directory) for retrieving Kubernetes resources and
running commands. However, additional kubeconfig files may be configured.
Add additional kubeconfig files
To add additional kubeconfig files:
Open the command palette (press Ctrl/Cmd+Shift+P or click
View > Command Palette), and then run
Cloud Code: Switch kubeconfig.
Click + Load kubeconfig, and then navigate to the location of the
kubeconfig file you want to add.
Select the kubeconfig file you want to add, and then click
Add KubeConfig Path.
Provide a name for the new kubeconfig when prompted.
Press Enter to confirm.
Remove kubeconfig files
To remove kubeconfig files:
Open the command palette (press Ctrl/Cmd+Shift+P or click
View > Command Palette), and then run
Cloud Code: Remove KubeConfig from Kubernetes Explorer.
Select the checkbox next to the kubeconfig you want to remove, and then
click Ok.
Switch kubeconfigs
You can switch kubeconfigs using the Command palette. To switch kubeconfigs:
Open the Command palette, and then run Cloud Code: Switch KubeConfig.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-07 UTC."],[[["\u003cp\u003eKubeconfig files are Kubernetes configuration files that manage cluster access, users, and contexts, and Cloud Code utilizes them for various operations.\u003c/p\u003e\n"],["\u003cp\u003eCloud Code defaults to the kubeconfig file in the \u003ccode\u003e$HOME/.kube\u003c/code\u003e directory but allows the addition of other kubeconfig files for managing different contexts.\u003c/p\u003e\n"],["\u003cp\u003eYou can add kubeconfig files in Cloud Code by using the "Cloud Code: Switch kubeconfig" command in the command palette and navigating to the desired file, and you can name them as well.\u003c/p\u003e\n"],["\u003cp\u003eRemoving kubeconfig files in Cloud Code is possible by using the command "Cloud Code: Remove KubeConfig from Kubernetes Explorer", and selecting the files to remove.\u003c/p\u003e\n"],["\u003cp\u003eSwitching between different kubeconfigs is easily done through the command palette by using the "Cloud Code: Switch KubeConfig" command and selecting the desired kubeconfig.\u003c/p\u003e\n"]]],[],null,[]]