Dokumen ini memberikan petunjuk pemecahan masalah untuk penyiapan tingkat fleet dari autentikasi dari penyedia identitas pihak ketiga.
Menyelesaikan masalah penyiapan tingkat fleet
Untuk menyelesaikan masalah yang mungkin terjadi saat menyiapkan fleet, ikuti petunjuk berikut:
1. Memvalidasi apakah GKE Identity Service diaktifkan
Untuk memvalidasi apakah GKE Identity Service diaktifkan untuk project Anda, jalankan perintah berikut:
$ gcloud container fleet identity-service describe
Jika tidak melihat error apa pun, GKE Identity Service diaktifkan dan Anda dapat melanjutkan ke petunjuk berikutnya.
Error:
Identity Service Feature for project <your-project-id> is not enabled
Jika Anda melihat error ini, berarti GKE Identity Service tidak diaktifkan dengan benar untuk fleet Anda saat menyiapkan fitur.
Solusi: Untuk memastikan fitur diaktifkan untuk project Anda, lihat petunjuk di Mengonfigurasi cluster untuk GKE Identity Service.
2. Melihat status GKE Identity Service
Untuk melihat status GKE Identity Service saat ini, jalankan perintah berikut:
$ gcloud container fleet identity-service describe
Output perintah ini memiliki dua bagian berikut:
membershipSpecsberisi konfigurasi penyedia identitas yang telah Anda tentukan untuk setiap cluster yang terdaftar ke fleet. GKE Identity Service dikonfigurasi di setiap cluster menggunakan konfigurasi ini.membershipStatesmenampilkan status GKE Identity Service saat ini di setiap cluster, termasuk konfigurasi penyedia identitas yang relevan dan error apa pun yang mungkin terjadi selama penyiapan.
Untuk memecahkan masalah di cluster, di bagian membershipStates, telusuri cluster dan cari kolom berikut:
statekolom:membershipStates -> <cluster-identifier> -> identityservice -> state- Kolom
failureReason:membershipStates -> <cluster-identifier> -> identityservice -> failureReason.
Contoh
Jika Anda memiliki dua cluster helloworld dan foobar yang terdaftar ke fleet, outputnya akan memiliki struktur berikut:
Identity Service Feature:
createTime: '222-11-10T23:05:6.146566392Z'
membershipSpecs:
projects/<your-project-number>/locations/<location>/memberships/helloworld:
identityservice:
authMethods:
- name: oidc
oidcConfig:
clientId: id
issuerUri: https://accounts.google.com
... other fields
projects/<your-project-number>/locations/<location>/memberships/foobar:
identityservice:
authMethods:
- name: oidc
oidcConfig:
clientId: id
issuerUri: https://accounts.google.com
... other fields
membershipStates:
projects/<your-project-number>/location/<location>/memberships/helloworld:
identityservice:
failureReason: AIS feature does not support this cluster type
memberConfig:
authMethods:
- name: oidc
oidcConfig:
clientId: id
issuerUri: https://accounts.google.com
... other fields
state: ERROR
state:
code: OK
updateTime: '2022-11-11T20:39:59.556176650Z'
projects/<your-project-number>/location/<location>/memberships/foobar:
identityservice:
memberConfig:
authMethods:
- name: oidc
oidcConfig:
clientId: id
issuerUri: https://accounts.google.com
... other fields
state: OK
state:
code: OK
updateTime: '2022-11-11T20:39:59.556176650Z'
name: projects/<project-number>/locations/global/features/identityservice
updateTime: '2022-11-11T20:40:31.859321901Z'
3. Memverifikasi status cluster
Untuk memverifikasi status GKE Identity Service di cluster, periksa hal berikut:
Nilai
stateadalahOK: Hal ini menunjukkan bahwa tidak ada error yang terjadi saat mengonfigurasi GKE Identity Service di cluster dengan konfigurasi yang ditentukan di bagianmembershipSpecs.Jika konfigurasi untuk cluster yang Anda pecahkan masalahnya (misalnya,
helloworld) berbeda dimembershipSpecsdanmembershipStates, kemungkinan Anda telah memperbarui konfigurasi untuk cluster tersebut. Tunggu beberapa menit hingga GKE Identity Service menyebarkan perubahan ke cluster dan periksa statusnya lagi.Jika konfigurasi untuk cluster yang Anda pecahkan masalahnya (misalnya,
helloworld) sama dimembershipSpecsdanmembershipStates, berarti GKE Identity Service telah dikonfigurasi dengan benar.Kolom
stateadalahERROR: Hal ini menunjukkan bahwa terjadi error saat mengonfigurasi GKE Identity Service di cluster dengan konfigurasi yang ditentukan di bagianmembershipSpecs.Untuk mengatasi masalah ini, lihat Memecahkan masalah umum. Setelah mengikuti langkah-langkah pemecahan masalah yang diperlukan, tunggu beberapa menit, lalu periksa statusnya lagi.
Memecahkan masalah umum
GKE Identity Service API tidak diaktifkan
Masalah ini terjadi saat GKE Identity Service API tidak diaktifkan.
Pesan error
anthosidentityservice.googleapis.com is not enabled
Solusi
Untuk mengaktifkan API, jalankan perintah berikut:
$ gcloud services enable anthosidentityservice.googleapis.com
Jenis cluster tidak didukung
Masalah ini terjadi saat Anda menggunakan jenis cluster yang tidak didukung.
Pesan error
GKE Identity Service feature does not support this cluster type
Solusi
Untuk mengetahui informasi tentang jenis cluster yang didukung, lihat jenis cluster atau hubungi dukungan Google Cloud untuk permintaan jenis cluster baru .
Protokol yang tidak didukung ditemukan dalam konfigurasi
Masalah ini terjadi saat konfigurasi identitas yang telah Anda terapkan ke cluster berisi protokol yang tidak didukung.
Pesan error
unsupported protocol found in configuration, aborting reconciliation.
Solusi
Penyiapan tingkat fleet untuk GKE Identity Service mendukung hal berikut:
Perbarui konfigurasi di cluster sehingga hanya berisi protokol yang didukung di atas. Untuk mengedit konfigurasi, jalankan perintah berikut:
kubectl --kubeconfig CLUSTER_KUBECONFIG -n kube-public edit clientconfig default
Ganti CLUSTER_KUBECONFIG dengan jalur ke file kubeconfig untuk cluster. Jika ada beberapa konteks dalam kubeconfig, konteks saat ini akan digunakan. Anda mungkin perlu mereset konteks saat ini ke cluster yang benar sebelum menjalankan perintah.
Cluster tidak memiliki konfigurasi identitas
Masalah ini terjadi saat tidak ada konfigurasi yang diterapkan ke cluster Anda.
Pesan error
Authentication configuration is not present for this membership
Solusi
Terapkan konfigurasi identitas ke cluster dengan mengikuti petunjuk di Mengonfigurasi cluster.
Izin IAM admin GKE Hub tidak ada
Masalah ini terjadi saat Anda tidak memiliki peran gkehub.admin di project yang Anda gunakan.
Pesan error
PERMISSION_DENIED: Permission 'gkehub.memberships.list' denied on '`projects//locations/ /memberships`'
PERMISSION_DENIED: Permission 'gkehub.features.get' denied on '`projects//locations/global/features/identityservice`'
PERMISSION_DENIED: Permission 'gkehub.features.delete' denied on '`projects//locations/global/features/identityservice`'
PERMISSION_DENIED: Permission 'gkehub.features.create' denied on '`projects//locations/global/features/identityservice`'
Solusi
Pemilik project dengan ID project_id harus menjalankan perintah berikut:
gcloud projects add-iam-policy-binding project_id --member=user:USER_ID --role=roles/gkehub.admin
Ganti USER_ID dengan Akun Google Anda.
Penyedia identitas non-unik ada dalam konfigurasi identitas
Masalah ini terjadi saat konfigurasi GKE Identity Service untuk cluster memiliki nilai name yang sama untuk beberapa penyedia identitas.
Pesan error
Configuration contains multiple identity providers with the same name
Solusi
Ganti nama atau hapus entri duplikat dari konfigurasi Anda.
Beberapa penyedia berjenis google ada dalam konfigurasi identitas
Masalah ini terjadi saat ClientConfig dikonfigurasi dengan beberapa konfigurasi berjenis google.
Pesan error
configuration contains multiple identity providers of type 'google'
Solusi
Bagian spec/authentication dari konfigurasi dapat berisi maksimal satu konfigurasi berjenis google.
Perbarui konfigurasi di cluster sehingga tidak memiliki lebih dari satu konfigurasi berjenis google. Untuk mengedit konfigurasi, jalankan perintah berikut:
kubectl --kubeconfig CLUSTER_KUBECONFIG -n kube-public edit clientconfig default
Ganti CLUSTER_KUBECONFIG dengan jalur ke file kubeconfig untuk cluster. Jika ada beberapa konteks dalam kubeconfig, konteks saat ini akan digunakan. Anda mungkin perlu mereset konteks saat ini ke cluster yang benar sebelum menjalankan perintah.
Error saat mengambil definisi resource kustom ClientConfig
Masalah ini terjadi saat terjadi error saat mengambil definisi resource kustom ClientConfig dari cluster.
Pesan error
error fetching the ClientConfig's Custom Resource Definition: ERROR_REASON
Solusi
Gunakan detail yang ditampilkan di ERROR_REASON untuk mengatasi masalah ini.
Error saat memperbarui GKE Identity Service ClientConfig
Masalah ini terjadi saat terjadi error saat memperbarui ClientConfig di cluster.
Pesan error
Error updating AIS ClientConfig: ERROR_REASON
Solusi
Gunakan detail yang ditampilkan di ERROR_REASON> untuk mengatasi masalah ini.
ClientConfig tidak ada di cluster
Masalah ini terjadi saat ClientConfig, yang seharusnya dibuat saat menginstal GKE Identity Service, tidak ada di cluster. ClientConfig yang tidak ada menunjukkan bahwa GKE Identity Service belum diinstal dengan benar di cluster.
Pesan error
ClientConfig CR not present, expected to be created when AIS was installed
Solusi
Resource GKE Identity Service di cluster mungkin telah dihapus secara tidak sengaja. Anda dapat mencoba membuat cluster baru. Jika Anda melihat error yang sama di cluster baru, hubungi administrator cluster atau dukungan Google Cloud.
Pod GKE Identity Service tidak dimulai
Masalah ini terjadi saat pod GKE Identity Service dalam status pending.
Pesan error
GKE Identity Service pod is not running (pending)
Solusi
Masalah ini akan otomatis teratasi dalam beberapa menit, setelah itu pod GKE Identity Service akan beralih ke status running.