Work with kubeconfig files in Cloud Code for IntelliJ
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:
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.
Learn more about Cloud Code's
YAML editing
assistance.
Get support
To submit feedback or report an issue in your IntelliJ IDE, go to
Tools > Cloud Code > Help / About > Submit
feedback or report an issue to report an issue on GitHub.
[[["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-28 UTC."],[[["\u003cp\u003eKubeconfig files are Kubernetes configuration files that manage cluster access, users, and contexts, and Cloud Code utilizes them for managing Kubernetes resources.\u003c/p\u003e\n"],["\u003cp\u003eCloud Code allows you to add, remove, and switch between different kubeconfig files through its settings panel, located under \u003cstrong\u003eFile\u003c/strong\u003e > \u003cstrong\u003eSettings\u003c/strong\u003e > \u003cstrong\u003eTools\u003c/strong\u003e > \u003cstrong\u003eCloud Code\u003c/strong\u003e > \u003cstrong\u003eKubernetes\u003c/strong\u003e.\u003c/p\u003e\n"],["\u003cp\u003eYou can easily switch the active kubeconfig for the resource browser through a dropdown menu, enabling you to view and manage resources in different clusters.\u003c/p\u003e\n"],["\u003cp\u003eCloud Code Run Configurations can be modified to use specific kubeconfig files, allowing for targeted deployments and operations on different clusters.\u003c/p\u003e\n"],["\u003cp\u003eNew kubeconfigs can be added directly via both the Kubeconfigs dropdown menu and in the run configuration view.\u003c/p\u003e\n"]]],[],null,["# Work with kubeconfig files in Cloud Code for IntelliJ\n\nkubeconfig files are Kubernetes configuration files that organize cluster\naccess, users, and contexts. This page shows you how to add, delete and switch\nbetween different kubeconfigs in Cloud Code.\n\nFor more information about kubeconfig files, see the Kubernetes documentation on\n[organizing cluster access using kubeconfig files](https://kubernetes.io/docs/concepts/configuration/organize-cluster-access-kubeconfig/).\n\nManage kubeconfigs\n------------------\n\nBy default, the Cloud Code plugin uses the default kubeconfig file (located\nunder the `$HOME/.kube` directory) for retrieving Kubernetes resources and\nrunning commands. However, additional kubeconfig files may be configured.\n\n### Add additional kubeconfig files\n\nTo add additional kubeconfig files:\n\n1. Navigate to Cloud Code settings within your IDE (**File** \\\u003e **Settings** \\\u003e **Tools** \\\u003e **Cloud Code** \\\u003e **Kubernetes** or for Mac OS X, **IntelliJ IDEA** \\\u003e **Preferences** \\\u003e **Tools** \\\u003e **Cloud Code** \\\u003e **Kubernetes**).\n2. In the **kubeconfigs** section, click the **+ Add kubeconfig** icon or press `Alt`+`insert` to bring up the selection dialog.\n3. In the **Select kubeconfig file** dialog, navigate to the location of the kubeconfig file you want to add.\n4. Select the kubeconfig file you want to use, and then click **Ok**.\n5. In the **Settings** dialog, click **OK** to save your changes.\n\n### Remove kubeconfig files\n\nTo remove kubeconfig files:\n\n1. Navigate to Cloud Code settings within your IDE (**File** \\\u003e **Settings** \\\u003e **Tools** \\\u003e **Cloud Code** \\\u003e **Kubernetes** or for Mac OS X, **IntelliJ IDEA** \\\u003e **Preferences** \\\u003e **Tools** \\\u003e **Cloud Code** \\\u003e **Kubernetes**).\n2. In the **kubeconfigs** section, click the kubeconfig you want to remove, and then click the **- Remove** icon or press `Alt`+`Delete`.\n3. Click **Ok** to save your changes.\n\n### Switch kubeconfigs\n\nYou can toggle the resource browser's current kubeconfig by clicking on\nthe kubeconfigs drop-down menu and selecting the kubeconfig you want to use.\nUpon selecting a kubeconfig, the tool window updates to use the chosen\nkubeconfig.\n\n**Tip**: New kubeconfigs can be added directly using the kubeconfigs drop-down\nmenu.\n\n### Using Cloud Code Run Configurations\n\nCloud Code Run Configurations can be modified to use alternate\nkubeconfig files. To change kubeconfigs, open the Run Configuration to modify\nand under **Run** \\\u003e **Advanced settings**, select the kubeconfig you want to\nuse from the kubeconfig drop-down menu.\nUpon selecting a kubeconfig, available contexts update to reflect those found in\nthe selected kubeconfig.\n\n**Tip** : New kubeconfigs can be added directly from run configurations by\nclicking **+ Add** to the right of the drop-down.\n\nWhat's next\n-----------\n\n- [Organize your cluster access using kubeconfig files](https://kubernetes.io/docs/concepts/configuration/organize-cluster-access-kubeconfig/).\n- [Develop and debug parts of a microservice application](/code/docs/intellij/speed-up-k8s-development#develop_microservices_applications_using_skaffold_configurations) using skaffold.\n- Learn more about Cloud Code's [YAML editing](/code/docs/intellij/yaml-editing) assistance.\n\nGet support\n-----------\n\nTo submit feedback or report an issue in your IntelliJ IDE, go to **Tools** \\\u003e **Cloud Code** \\\u003e **Help / About** \\\u003e **Submit\nfeedback or report an issue** to report an issue on [GitHub](https://github.com/GoogleCloudPlatform/cloud-code-intellij/issues)."]]