Tetap teratur dengan koleksi
Simpan dan kategorikan konten berdasarkan preferensi Anda.
Memilih metode akses untuk login ke cluster
Dokumen ini ditujukan untuk developer dan pengguna cluster GKE lainnya yang perlu login ke cluster dari command line menggunakan Identity Service GKE.
Sebelum memulai
Login dari command line
Login ke cluster dengan Identity Service GKE dari command line memerlukan perintah autentikasi gcloud yang berjalan. Jika Anda ingin menggunakan salah satu opsi login command line, lakukan tindakan berikut:
Pastikan Anda telah menginstal alat command line berikut:
Google Cloud CLI versi terbaru, yang mencakup gcloud, alat command line untuk berinteraksi dengan Google Cloud. Jika Anda perlu menginstal Google Cloud CLI, lihat panduan penginstalan.
kubectl untuk menjalankan perintah terhadap cluster Kubernetes. Jika Anda perlu menginstal kubectl, lihat panduan penginstalan.
Jalankan perintah berikut untuk menginstal atau mengupdate komponen anthos-auth:
Pastikan komponen berhasil diinstal dengan menjalankan perintah berikut:
gcloud anthos auth version
Jika versi ditampilkan, penginstalan Anda berhasil.
Login dari konsol Google Cloud
Khusus untuk penyedia OIDC dan AzureAD, Anda juga dapat login ke cluster dari konsol Google Cloud tanpa file konfigurasi atau FQDN. Untuk mengetahui informasi selengkapnya, lihat Menggunakan cluster dari Google Cloud konsol.
Metode akses untuk login ke cluster
Untuk login ke cluster yang dikonfigurasi, gunakan salah satu metode akses berikut:
Login dari command line dengan akses FQDN: Jika Anda perlu login ke cluster menggunakan nama domain yang sepenuhnya memenuhi syarat, lihat Akses FQDN.
Login dari command line dengan akses berbasis file: Jika Anda perlu login ke cluster dengan file konfigurasi, lihat akses berbasis file.
[[["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-07-22 UTC."],[],[],null,["# Choose an access method to log in to clusters\n=============================================\n\nThis document is for developers and other GKE cluster users who need to log in to clusters from the command line using GKE Identity Service.\n\nBefore you begin\n----------------\n\n- Log in from the command line\n\n Logging in to clusters with GKE Identity Service from the command line requires running `gcloud` authentication commands. If you want to use one of the command line login options, do the following:\n 1. Ensure that you have the following command line tools installed:\n\n - The latest version of the Google Cloud CLI, which includes `gcloud`, the command line tool for interacting with Google Cloud. If you need to install the Google Cloud CLI, see the [installation guide](/sdk/docs/install).\n - `kubectl` for running commands against Kubernetes clusters. If you need to install `kubectl`, see the [installation guide](/kubernetes-engine/docs/how-to/cluster-access-for-kubectl).\n 2. Run the following commands to install or update the `anthos-auth` component:\n\n ```\n gcloud components update\n gcloud components install anthos-auth\n ```\n 3. Verify that the component was installed successfully by running the following command:\n\n ```\n gcloud anthos auth version\n ```\n\n If a version is returned, your installation was successful.\n- Log in from the Google Cloud console\n\n For OIDC and AzureAD providers only, you can also log in to clusters from the Google Cloud console without a configuration file or FQDN. For more information, see [Work with clusters from the Google Cloud console](/kubernetes-engine/fleet-management/docs/console).\n\nAccess methods to log in to clusters\n------------------------------------\n\nTo log in to your configured clusters, use one of the following access methods:\n\n- **Log in from the command line with FQDN access** : If you need to log in to your clusters using a fully qualified domain name, see [FQDN access](/kubernetes-engine/enterprise/identity/setup/authenticate-fqdn-access).\n- **Log in from the command line with file-based access** : If you need to log in to your clusters with a configuration file, see [file-based access](/kubernetes-engine/enterprise/identity/setup/authenticate-file-access)."]]