Dokumen ini menjelaskan resolusi untuk error managed workload identities umum.
Jika Pod workload Google Kubernetes Engine (GKE) gagal di-deploy dengan sertifikat yang di-mount, gunakan perintah berikut untuk memeriksa status Pod:
kubectl describe pod POD_NAME -n POD_NAMESPACE
Output perintah mencakup peristiwa Pod yang dihasilkan oleh kubelet dan
gke-spiffe-controller. Tinjau peristiwa ini untuk mengetahui pesan error tertentu, yang mungkin mencakup salah satu pesan berikut:
PermissionDenied error
Bagian ini menjelaskan error yang menampilkan kode error RPC PermissionDenied.
PRIVATE_CA_AUTHORIZATION_FAILURE
Error ini terlihat mirip dengan berikut ini:
Permission denied while issuing the certificate: failed to issue the certificate from the GKE Auth: rpc error: code = PermissionDenied desc = Permission 'privateca.caPools.get' denied on resource 'privateca.googleapis.com/projects/CA_POOL_PROJECT_NUMBER/locations/REGION/caPools/CA_POOL_ID' (or it may not exist). Ensure that the CaPool exists and you have authorized the Managed Workload Identity to request certificates from the CaPool.
Error terjadi karena workload identity pool tidak memiliki peran CA Service
Workload Certificate Requester
(roles/privateca.workloadCertificateRequester) di pool CA subordinat atau
karena pool CA tidak ada.
Untuk mengatasi error ini, berikan peran ke kumpulan:
gcloud privateca pools add-iam-policy-binding SUBORDINATE_CA_POOL_ID \
--project=CA_POOL_PROJECT_ID \
--location=REGION \
--role=roles/privateca.workloadCertificateRequester \
--member="principal://iam.googleapis.com/projects/WIP_PROJECT_NUMBER/name/locations/global/workloadIdentityPools/TRUST_DOMAIN_NAME"
Ganti kode berikut:
SUBORDINATE_CA_POOL_ID: ID pool CA bawahanCA_POOL_PROJECT_ID: project ID CA poolREGION: region CA subordinatWIP_PROJECT_NUMBER: nomor project dari project workload identity poolTRUST_DOMAIN_NAME: nama domain tepercaya. Bergantung pada jenis kumpulan, format nama sebagai berikut:- Kumpulan yang dikelola Google:
PROJECT_ID.svc.id.goog - Kumpulan yang dikelola sendiri:
POOL_NAME.global.POOL_HOST_PROJECT_NUMBER.workload.id.goog
- Kumpulan yang dikelola Google:
WORKLOAD_IDENTITY_NOT_FOUND, WORKLOAD_POOL_NOT_FOUND, atau WORKLOAD_NAMESPACE_NOT_FOUND
Error ini terlihat mirip dengan berikut ini:
failed to issue the certificate from the GKE Auth: rpc error: code = PermissionDenied desc = Permission denied on resource 'projects/PROJECT_NUMBER/locations/global/workloadIdentityPools/POOL_NAME/... (or it may not exist).
Error ini dipetakan ke WORKLOAD_IDENTITY_NOT_FOUND, WORKLOAD_POOL_NOT_FOUND, atau
WORKLOAD_NAMESPACE_NOT_FOUND. Error ini terjadi jika workload identity pool, namespace workload identity pool, atau resource managed identity tidak ada, atau jika resource tersebut dinonaktifkan atau dihapus. Perhatikan bahwa error ini menampilkan
PermissionDenied, bukan NotFound, untuk menghindari kebocoran tidak adanya resource.
Untuk mengatasi error ini, verifikasi keberadaan dan status workload identity pool dan sub-resource-nya di IAM. Pastikan perangkat dikonfigurasi dengan benar dan tidak dinonaktifkan atau dihapus.
FailedPrecondition error
Bagian ini menjelaskan error yang menampilkan kode error RPC FailedPrecondition,
yang biasanya menunjukkan konfigurasi yang tidak ada atau salah.
WORKLOAD_IDENTITY_INVALID_CONFIGURATION
Deskripsi Pod dapat menyertakan salah satu pesan berikut:
failed to issue the certificate from the GKE Auth: rpc error: code = FailedPrecondition desc = There are no CaPools configured for certificate issuance. Ensure you have added certificate issuance configuration to the workload identity pool 'projects/PROJECT_NUMBER/locations/global/workloadIdentityPools/WI_POOL_NAME', which contains at least one CaPool.
atau
failed to issue the certificate from the GKE Auth: rpc error: code = FailedPrecondition desc = Missing Certificate issuance configuration in the Trust Domain. Ensure you have added certificate issuance configuration to the workload identity pool 'projects/PROJECT_NUMBER/locations/global/workloadIdentityPools/WI_POOL_NAME' which contains at least one CaPool.
Error ini (WORKLOAD_IDENTITY_INVALID_CONFIGURATION) terjadi karena
pool identitas beban kerja tidak dikonfigurasi dengan konfigurasi penerbitan sertifikat (CIC) atau karena CIC yang dikonfigurasi tidak berisi setidaknya satu
pool CA.
Untuk mengatasi error ini, buat CIC yang berisi setidaknya satu CA pool dan gunakan untuk memperbarui workload identity pool.
CERTIFICATE_AUTHORITY_NOT_FOUND
Error ini terlihat mirip dengan berikut ini:
failed to issue the certificate from the GKE Auth: rpc error: code = FailedPrecondition desc = Failed to request certificates from the CaPool... There are no enabled CAs in the CaPool. Ensure that there is at least one enabled Certificate Authority to issue a certificate.
Error ini (CERTIFICATE_AUTHORITY_NOT_FOUND) menunjukkan bahwa Otoritas Sertifikat tidak dapat ditemukan untuk penerbitan sertifikat di kumpulan CA yang dikonfigurasi pelanggan.
Untuk mengatasi error ini, pastikan Otoritas Sertifikat ada di pool CA yang dikonfigurasi dan diaktifkan untuk penerbitan sertifikat.
CA_POOL_REGION_MISMATCH
Error ini terlihat mirip dengan berikut ini:
failed to issue the certificate from the GKE Auth: rpc error: code = FailedPrecondition desc = Unable to find a CaPool in the workload's region. Ensure you have setup a subordinate CaPool in 'WORKLOAD_REGION' and added it to the certificate issuance configuration of the Workload Identity Pool...
Error ini (CA_POOL_REGION_MISMATCH) menunjukkan bahwa tidak ada kumpulan CA yang dikonfigurasi untuk region tertentu dari workload.
Untuk mengatasi error ini, konfigurasi pool CA tambahan untuk region workload di workload identity pool atau deploy workload di region yang sudah mengonfigurasi pool CA.
ResourceExhausted error
Bagian ini menjelaskan error yang menampilkan kode error RPC ResourceExhausted.
PRIVATE_CA_QUOTA_EXCEEDED
Error ini terlihat mirip dengan berikut ini:
failed to issue the certificate from the GKE Auth: rpc error: code = ResourceExhausted desc = Quota exceeded for quota metric 'QUOTA_METRIC' and limit 'QUOTA_LIMIT' of service 'privateca.googleapis.com' for consumer 'project_number:PROJECT_NUMBER'.
Error ini (PRIVATE_CA_QUOTA_EXCEEDED) terjadi saat Anda mengonfigurasi kumpulan identitas
beban kerja untuk menggunakan CA kustom, dan upaya untuk menerbitkan sertifikat telah
melampaui kuota atau batas yang ditetapkan terkait dengan Layanan CA.
Error ini tidak terjadi jika Anda menggunakan CA default yang dikelola Google.
QUOTA_METRICdanQUOTA_LIMIT: Metrik dan batas kuota tertentu yang terlampaui. Misalnya,privateca.googleapis.com/enterprise_certificate_issuancedanCertsPerEnterpriseCaPerMinute.
Untuk mengatasi error ini, tinjau kuota dan batas Layanan CA Anda di konsol Google Cloud , dan minta penambahan kuota jika perlu.
InvalidArgument error
Bagian ini menjelaskan error yang menampilkan kode error RPC InvalidArgument.
PRIVATE_CA_KEY_ALGORITHM_MISMATCH
Error ini terlihat mirip dengan berikut ini:
failed to issue the certificate from the GKE Auth: rpc error: code = InvalidArgument desc = Public key algorithm is not permitted by the CaPool's issuance policy. Ensure that the requested keyAlgorithm 'KEY_ALGO_IN_CSR' is permitted by the CAs in the CaPool 'privateca.googleapis.com/projects/PROJECT_NAME/locations/WORKLOAD_REGION/caPools/CA_POOL_NAME'.
Error ini (PRIVATE_CA_KEY_ALGORITHM_MISMATCH) menunjukkan bahwa algoritma
kunci yang ditentukan dalam permintaan sertifikat tidak kompatibel dengan
batasan kumpulan CA yang dikonfigurasi. Hal ini hanya terjadi saat Anda mengonfigurasi algoritma
kunci kustom dalam konfigurasi penerbitan sertifikat (CIC) dan memperbarui
workload identity pool.
Untuk mengatasi error ini, pastikan algoritma yang dikonfigurasi di CIC pool workload identity kompatibel dengan algoritma yang didukung oleh kebijakan penerbitan pool CA.
Unknown error
Bagian ini menjelaskan error yang menampilkan kode error RPC Unknown.
UNKNOWN_PRIVATE_CA_CLIENT_ERROR
Error ini terlihat mirip dengan berikut ini:
failed to issue the certificate from the GKE Auth: rpc error: code = Unknown desc = Failed to get certificates using the CaPool... PRIVATE_CA_ERROR_MESSAGE
Error ini (UNKNOWN_PRIVATE_CA_CLIENT_ERROR) menunjukkan bahwa error klien yang tidak diketahui, seperti argumen tidak valid yang diberikan ke API, telah terjadi saat memanggil Layanan CA.
Untuk mengatasi error ini, tinjau pesan error spesifik yang ditampilkan dari CA Service API untuk mengidentifikasi argumen yang tidak valid atau masalah konfigurasi sisi klien dan perbaiki.
Latensi propagasi paket tepercaya
Saat Anda memperbarui atau mengganti CA yang dikelola sendiri, ada latensi propagasi sekitar 5 menit sebelum pembaruan diterapkan pada "cluster GKE". Hal ini karena gke-spiffe-controller memeriksa keanggotaan dan mengambil paket kepercayaan setiap lima menit.
Latensi ini tidak terjadi jika Anda menggunakan CA yang dikelola Google.
Jika Anda memperbarui CA yang dikelola sendiri, tunggu setidaknya lima menit agar perubahan diterapkan.