What is the correct sequence of steps to configure a Kubernetes Service Account (KSA) to impersonate a Google Cloud Service Account (GSA) using GKE Workload Identity?
- 1Create a Google Cloud Service Account (GSA) and grant it the necessary Google Cloud IAM roles.
- 2Create a Kubernetes Service Account (KSA) within the GKE cluster namespace where the application workload runs.
- 3Allow the KSA to impersonate the GSA by granting the roles/iam.workloadIdentityUser role on the GSA to the KSA member.
- 4Annotate the Kubernetes Service Account with the email address of the Google Cloud Service Account.
Cevap
The correct operational sequence begins with creating the Google Cloud Service Account with required permissions, followed by creating the Kubernetes Service Account in GKE, binding the Workload Identity User IAM role on the GSA to the KSA, and finally annotating the KSA with the GSA email address.
Configuring Workload Identity follows a logical top-down sequence: first provision the GCP-side Service Account with appropriate permissions, next create the GKE Kubernetes Service Account, then grant the roles/iam.workloadIdentityUser IAM role on the GSA to the KSA, and lastly annotate the KSA with the GSA email address so the GKE metadata server can exchange Kubernetes tokens for Google Cloud credentials.
Adım Adım Çözüm
Anahtar Kavram
GKE Workload Identity Configuration Sequence