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.
For more information about kubeconfig files, see the Kubernetes documentation on organizing cluster access using kubeconfig files.
Manage kubeconfigs
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:
- Navigate to Cloud Code settings within your IDE (File > Settings > Tools > Cloud Code > Kubernetes or for Mac OS X, IntelliJ IDEA > Preferences > Tools > Cloud Code > Kubernetes).
- In the kubeconfigs section, click the + Add kubeconfig icon or press
Alt
+insert
to bring up the selection dialog. - In the Select kubeconfig file dialog, navigate to the location of the kubeconfig file you want to add.
- Select the kubeconfig file you want to use, and then click Ok.
- In the Settings dialog, click OK to save your changes.
Remove kubeconfig files
To remove kubeconfig files:
- Navigate to Cloud Code settings within your IDE (File > Settings > Tools > Cloud Code > Kubernetes or for Mac OS X, IntelliJ IDEA > Preferences > Tools > Cloud Code > Kubernetes).
- In the kubeconfigs section, click the kubeconfig you want to remove, and
then click the - Remove icon or press
Alt
+Delete
. - Click Ok to save your changes.
Switch kubeconfigs
You can toggle the resource browser's current kubeconfig by clicking on the kubeconfigs drop-down menu and selecting the kubeconfig you want to use. Upon selecting a kubeconfig, the tool window updates to use the chosen kubeconfig.
Tip: New kubeconfigs can be added directly using the kubeconfigs drop-down menu.
Using Cloud Code Run Configurations
Cloud Code Run Configurations can be modified to use alternate kubeconfig files. To change kubeconfigs, open the Run Configuration to modify and under Run > Advanced settings, select the kubeconfig you want to use from the kubeconfig drop-down menu. Upon selecting a kubeconfig, available contexts update to reflect those found in the selected kubeconfig.
Tip: New kubeconfigs can be added directly from run configurations by clicking + Add to the right of the drop-down.
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's YAML editing assistance.