Prepare and test your skills

Prepare and test your skills

Free sample question with answers and detailed explanation below. The Professional Cloud Network Engineer practice bank has an additional 2,437 practice questions.Try 10 free realistic questions: instant score, no credit card, and no account required.
Your organization manages a Shared VPC host project (host-vpc-prod) with two subnets in us-central1: tier-1-subnet and tier-2-subnet. Using gcloud compute shared-vpc associated-projects add, you attached service project svc-app-1 (project number 111111111111) and svc-app-2 (project number 222222222222) to host-vpc-prod. The GKE API is enabled in all projects.
You must deploy a GKE cluster in svc-app-1 while enforcing strict least-privilege requirements:
svc-app-1 to deploy cluster nodes and pods only into tier-1-subnet.svc-app-1 from using tier-2-subnet or any future subnets in host-vpc-prod.Which IAM role bindings should you configure in host-vpc-prod?
tier-1-subnet, grant roles/compute.networkUser to service-111111111111@container-engine-robot.iam.gserviceaccount.com only. 2. On host-vpc-prod, grant roles/container.hostServiceAgentUser to service-111111111111@container-engine-robot.iam.gserviceaccount.com.
This option correctly scopes roles/compute.networkUser to tier-1-subnet and grants roles/container.hostServiceAgentUser at the host project level to the GKE service agent, but it omits the Google APIs service agent (111111111111@cloudservices.gserviceaccount.com) from the subnet IAM policy.
@container-engine-robot.iam.gserviceaccount.com) orchestrates Kubernetes control plane networking and IP allocation, the Google APIs service agent (@cloudservices.gserviceaccount.com) is responsible for calling Compute Engine APIs to create managed instance groups and VM instances for GKE worker nodes.roles/compute.networkUser on tier-1-subnet, the Google APIs service agent lacks permission to attach node network interfaces to the Shared VPC subnet, causing cluster creation or node pool scaling to fail.roles/compute.networkUser on the target subnet.tier-1-subnet via gcloud compute networks subnets set-iam-policy, both service agent principals must be included in the bindings list for roles/compute.networkUser.roles/container.hostServiceAgentUser on the host project, whereas both agents need roles/compute.networkUser on the subnet.The binding on tier-1-subnet for roles/compute.networkUser also included 111111111111@cloudservices.gserviceaccount.com alongside service-111111111111@container-engine-robot.iam.gserviceaccount.com.
When attaching service projects through the Google Cloud console with Kubernetes Engine access enabled, Google Cloud automatically adds both service agents (as well as the Compute Engine default service account) to the subnet's Compute Network User binding; when using gcloud, administrators must explicitly include both required service agents.
host-vpc-prod, grant roles/compute.networkUser to service-111111111111@container-engine-robot.iam.gserviceaccount.com and 111111111111@cloudservices.gserviceaccount.com. 2. On host-vpc-prod, grant roles/container.hostServiceAgentUser to service-111111111111@container-engine-robot.iam.gserviceaccount.com.
This approach assigns the Compute Network User (roles/compute.networkUser) role at the host project level (host-vpc-prod) to both the service project's GKE service agent and Google APIs service agent, while also granting the Host Service Agent User (roles/container.hostServiceAgentUser) role to the GKE service agent on the host project.
roles/compute.networkUser at the host project level designates the principals as Service Project Admins for all subnets. This gives svc-app-1 permission to consume tier-1-subnet, tier-2-subnet, and any subnets created in host-vpc-prod in the future.svc-app-1 is not restricted to tier-1-subnet, workloads or cluster administrators in svc-app-1 can accidentally or intentionally provision GKE clusters in tier-2-subnet.roles/compute.networkUser at the host project level can view and use every subnet across all VPCs in the host project unless restricted by an organization policy.hostServiceAgentUser placement: The roles/container.hostServiceAgentUser binding is properly placed on the host project for the GKE service agent, but the overly broad roles/compute.networkUser binding undermines subnet segmentation.The organization wanted svc-app-1 to have unrestricted access to deploy GKE clusters into any current or future subnet in host-vpc-prod without subnet-level isolation.
When using the gcloud CLI to isolate service projects to dedicated subnets, roles/compute.networkUser must be applied directly to the target subnet's IAM policy using gcloud compute networks subnets set-iam-policy rather than gcloud projects add-iam-policy-binding.
tier-1-subnet, grant roles/compute.networkUser to service-111111111111@container-engine-robot.iam.gserviceaccount.com and 111111111111@cloudservices.gserviceaccount.com. 2. On host-vpc-prod, grant roles/container.hostServiceAgentUser to 111111111111@cloudservices.gserviceaccount.com.
This configuration properly grants roles/compute.networkUser on tier-1-subnet to both required service agents, but it incorrectly assigns the Host Service Agent User (roles/container.hostServiceAgentUser) role on host-vpc-prod to the Google APIs service agent (111111111111@cloudservices.gserviceaccount.com) instead of the GKE service agent.
hostServiceAgentUser: The roles/container.hostServiceAgentUser role is specifically designed to be granted only to a service project's GKE service agent (service-SERVICE_PROJECT_NUM@container-engine-robot.iam.gserviceaccount.com).service-111111111111@container-engine-robot.iam.gserviceaccount.com lacks roles/container.hostServiceAgentUser on host-vpc-prod, it cannot act through the host project's GKE service agent to configure Shared VPC cluster networking, causing cluster creation in svc-app-1 to fail.roles/container.hostServiceAgentUser permits the service project's GKE service agent to perform network management operations in the host project as if it were the host project's own GKE service agent.PROJECT_NUMBER@cloudservices.gserviceaccount.com) from GKE-specific cluster control plane orchestration (service-PROJECT_NUMBER@container-engine-robot.iam.gserviceaccount.com).gcloud compute shared-vpc associated-projects add does not enable GKE access automatically, administrators must manually bind roles/container.hostServiceAgentUser to the exact GKE service agent principal.The roles/container.hostServiceAgentUser binding on host-vpc-prod were granted to service-111111111111@container-engine-robot.iam.gserviceaccount.com instead of 111111111111@cloudservices.gserviceaccount.com.
To follow security best practices and avoid unnecessary permissions, never grant service agent roles like roles/container.hostServiceAgentUser to any principal other than the intended service agent.
tier-1-subnet, grant roles/compute.networkUser to service-111111111111@container-engine-robot.iam.gserviceaccount.com and 111111111111@cloudservices.gserviceaccount.com. 2. On host-vpc-prod, grant roles/container.hostServiceAgentUser to service-111111111111@container-engine-robot.iam.gserviceaccount.com.
This configuration establishes the exact cross-project IAM permissions required for a GKE cluster in a Shared VPC service project when service projects are attached via the gcloud CLI. It separates subnet-level network usage permissions (roles/compute.networkUser) from host project GKE service agent delegation (roles/container.hostServiceAgentUser).
tier-1-subnet: Granting roles/compute.networkUser on tier-1-subnet to both the GKE service agent (service-111111111111@container-engine-robot.iam.gserviceaccount.com) and the Google APIs service agent (111111111111@cloudservices.gserviceaccount.com) authorizes GKE control plane operations and Compute Engine instance group creation within that specific subnet.tier-2-subnet and future subnets: Because roles/compute.networkUser is bound strictly to tier-1-subnet's resource-level IAM policy instead of host-vpc-prod, svc-app-1 has zero network-usage permissions on tier-2-subnet or any newly created subnets.roles/container.hostServiceAgentUser on host-vpc-prod to service-111111111111@container-engine-robot.iam.gserviceaccount.com allows the service project's GKE service agent to act through the host project's GKE service agent to manage shared VPC resources.tier-1-subnet), preventing cross-tier IP exhaustion or unauthorized subnet access.roles/container.hostServiceAgentUser when GKE access is enabled—gcloud compute shared-vpc associated-projects add does not configure GKE IAM bindings automatically.hostServiceAgentUser, while both Google-managed service agents involved in cluster and node provisioning receive subnet access.Attaching roles/compute.networkUser at the subnet level for both required service agents and roles/container.hostServiceAgentUser at the host project level for the GKE service agent is the precise, least-privilege pattern for GKE on Shared VPC.
Answer them yourself and get your score the moment you finish. No account needed.
Full access includes
Keep the momentum going with these hand-picked practice scenarios
Last updated Validated