Work with kubeconfigs in Cloud Code for Cloud Shell Stay organized with collections Save and categorize content based on your preferences.
kubeconfig files are Kubernetes configuration files that organize clusteraccess, users, and contexts. This page shows you how to add, delete and switchbetween different kubeconfigs in Cloud Code.
For more information about kubeconfig files, see the Kubernetes documentation onorganizing cluster access using kubeconfig files.
Manage kubeconfigs
By default, the Cloud Code plugin uses the default kubeconfig file (locatedunder the$HOME/.kube directory) for retrieving Kubernetes resources andrunning 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+Por clickView >Command Palette), and then runCloud Code: Switch kubeconfig. - Click+ Load kubeconfig, and then navigate to the location of thekubeconfig file you want to add.
- Select the kubeconfig file you want to add, and then clickAdd KubeConfig Path.
- Provide a name for the new kubeconfig when prompted.
- Press
Enterto confirm.
Remove kubeconfig files
To remove kubeconfig files:
- Open the command palette (press
Ctrl/Cmd+Shift+Por clickView >Command Palette), and then runCloud Code: Remove KubeConfig from Kubernetes Explorer. - Select the checkbox next to the kubeconfig you want to remove, and thenclickOk.
Switch kubeconfigs
You can switch kubeconfigs using theCommand palette. To switch kubeconfigs:
- Open theCommand palette, and then runCloud Code: Switch KubeConfig.
- Click on the kubeconfig you want to use.
What's next
- Organize your cluster access using kubeconfig files.
- Develop and debug parts of a microservice application using skaffold.
- Learn more about Cloud Code'sYAML editing assistance.
Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-12-15 UTC.