By default, the Cloud Code extension 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.
To add or remove kubeconfigs, navigate to Cloud Code settings within your IDE (File > Settings > Cloud Code > Kubernetes or for Mac OS X, IntelliJ IDEA > Preferences > Cloud Code > Kubernetes).
Using the Kubernetes resource browser
You can easily 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/Debug 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 on the "+" button to the right of the drop-down.