Menggunakan file kubeconfig di Cloud Code for IntelliJ
Tetap teratur dengan koleksi
Simpan dan kategorikan konten berdasarkan preferensi Anda.
File kubeconfig adalah file konfigurasi Kubernetes yang mengatur akses
cluster, pengguna, dan konteks. Halaman ini menunjukkan cara menambahkan, menghapus, dan beralih
di antara berbagai kubeconfig di Cloud Code.
Secara default, plugin Cloud Code menggunakan file kubeconfig default (yang berada di
direktori $HOME/.kube) untuk mengambil resource Kubernetes dan
menjalankan perintah. Namun, file kubeconfig tambahan dapat dikonfigurasi.
Menambahkan file kubeconfig tambahan
Untuk menambahkan file kubeconfig tambahan:
Buka setelan Cloud Code dalam IDE Anda
(File > Settings > Tools > Cloud Code > Kubernetes atau
untuk Mac OS X, IntelliJ IDEA > Preferences > Tools >
Cloud Code > Kubernetes).
Di bagian kubeconfigs, klik ikon + Add kubeconfig atau tekan
Alt+insert untuk menampilkan dialog pilihan.
Dalam dialog Pilih file kubeconfig, buka lokasi file kubeconfig yang ingin Anda tambahkan.
Pilih file kubeconfig yang ingin Anda gunakan, lalu klik Oke.
Pada dialog Setelan, klik OK untuk menyimpan perubahan.
Menghapus file kubeconfig
Untuk menghapus file kubeconfig:
Buka setelan Cloud Code dalam IDE Anda
(File > Settings > Tools > Cloud Code > Kubernetes atau
untuk Mac OS X, IntelliJ IDEA > Preferences > Tools >
Cloud Code > Kubernetes).
Di bagian kubeconfigs, klik kubeconfig yang ingin Anda hapus, lalu
klik ikon - Hapus atau tekan Alt+Delete.
Klik Oke untuk menyimpan perubahan.
Mengganti kubeconfig
Anda dapat mengganti kubeconfig saat ini di browser resource dengan mengklik
menu drop-down kubeconfig dan memilih kubeconfig yang ingin Anda gunakan.
Setelah memilih kubeconfig, jendela alat akan diperbarui untuk menggunakan kubeconfig yang dipilih.
Tips: Kubeconfig baru dapat ditambahkan langsung menggunakan menu drop-down kubeconfig.
Menggunakan Konfigurasi Run Cloud Code
Konfigurasi Run Cloud Code dapat diubah untuk menggunakan file kubeconfig
alternatif. Untuk mengubah kubeconfig, buka Konfigurasi Run yang akan diubah
dan di bagian Run > Advanced settings, pilih kubeconfig yang ingin
Anda gunakan dari menu drop-down kubeconfig.
Setelah memilih kubeconfig, konteks yang tersedia akan diperbarui untuk mencerminkan konteks yang ditemukan di kubeconfig yang dipilih.
Tips: Kubeconfig baru dapat ditambahkan langsung dari konfigurasi run dengan
mengklik + Add di sebelah kanan drop-down.
Untuk mengirimkan masukan atau melaporkan masalah di IDE IntelliJ, buka
Tools > Cloud Code > Help / About > Submit
feedback or report an issue untuk melaporkan masalah di GitHub.
[[["Mudah dipahami","easyToUnderstand","thumb-up"],["Memecahkan masalah saya","solvedMyProblem","thumb-up"],["Lainnya","otherUp","thumb-up"]],[["Sulit dipahami","hardToUnderstand","thumb-down"],["Informasi atau kode contoh salah","incorrectInformationOrSampleCode","thumb-down"],["Informasi/contoh yang saya butuhkan tidak ada","missingTheInformationSamplesINeed","thumb-down"],["Masalah terjemahan","translationIssue","thumb-down"],["Lainnya","otherDown","thumb-down"]],["Terakhir diperbarui pada 2025-09-05 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)."]]