A Cloud Engineer is tasked with establishing passwordless, keyless authentication for a pod running in a Google Kubernetes Engine (GKE) cluster to query BigQuery tables. The team has mandated using GKE Workload Identity following Google Cloud best practices. In what precise sequence should the engineer execute the configuration steps to enable this access?
- 1Enable Workload Identity on the GKE cluster to establish the workload identity pool for the Google Cloud project.
- 2Create a Google Service Account (GSA) and grant it the BigQuery Data Viewer IAM role on the target project.
- 3Create a Kubernetes Service Account (KSA) inside the specific Kubernetes namespace where the application workload resides.
- 4Add an IAM policy binding granting the Workload Identity User role (roles/iam.workloadIdentityUser) on the GSA to the KSA's principal member URI.
- 5Annotate the Kubernetes Service Account (KSA) with the email address of the Google Service Account (GSA).
Answer
The correct sequence starts with enabling Workload Identity on the GKE cluster, creating and granting permissions to the Google Service Account (GSA), creating the Kubernetes Service Account (KSA) in the namespace, granting the Workload Identity User role on the GSA to the KSA member URI, and finally annotating the KSA with the GSA email.
The proper deployment flow for GKE Workload Identity requires infrastructure enablement first (enabling Workload Identity on the cluster), establishing both identity endpoints (GSA with BigQuery permissions and KSA in the namespace), authorizing the relationship in IAM (granting roles/iam.workloadIdentityUser on the GSA to the KSA principal URI), and completing the in-cluster mapping (annotating the KSA with the GSA email).
Step-by-Step Solution
Key Concept
GKE Workload Identity binding procedure