A cloud engineering team is configuring an automated CI/CD deployment pipeline using Cloud Build to deploy containerized microservices to a Google Kubernetes Engine (GKE) cluster. To comply with organizational security governance and the principle of least privilege, the team needs to assign permissions to the Cloud Build service account. Which configuration represents the optimal approach for granting Cloud Build access to deploy workloads to the cluster?
- Grant the Cloud Build service account the Kubernetes Engine Developer role (roles/container.developer) on the target cluster.Answer
- BGrant the Cloud Build service account the primitive Owner role (roles/owner) at the GCP project level.
- CGrant the Cloud Build service account the Service Account Admin role (roles/iam.serviceAccountAdmin) at the project level.
- DStore the deployment pipeline's Terraform state file in an unversioned local directory within the Cloud Build runner context.
Answer
Grant the Cloud Build service account the Kubernetes Engine Developer role (roles/container.developer) on the target cluster.
Granting the predefined Kubernetes Engine Developer role (`roles/container.developer`) provides the Cloud Build service account with the exact set of permissions required to deploy, update, and manage containerized workloads in the GKE cluster while preventing unauthorized changes to cluster infrastructure.
Step-by-Step Solution
Key Concept
Configuring least privilege IAM service account permissions for Cloud Build CI/CD deployments to GKE
Estimated Time:1m 0s