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.
You are deploying a private VPC-native GKE Standard cluster in a Shared VPC service project (svc-proj-1) using an existing subnet (gke-subnet) in the host project (host-proj). The network administrator in host-proj has already created gke-subnet with a primary range (10.10.0.0/22) and two secondary ranges (pod-range: 10.40.0.0/14 and svc-range: 10.10.32.0/20).
Your deployment must meet the following requirements:
host-proj so GKE in svc-proj-1 can provision the cluster into gke-subnet using the pre-defined secondary ranges.shared-net (10.0.0.0/8), while masquerading Pod traffic to node IP addresses when communicating with an on-premises network (192.168.0.0/16) over Cloud Interconnect.Which configuration should you implement?
host-proj, grant roles/container.hostServiceAgentUser on the project and roles/compute.networkUser on gke-subnet to the GKE service agent of svc-proj-1, and enable Private Google Access on gke-subnet. In svc-proj-1, create a Public Cloud NAT gateway for the primary range of gke-subnet and deploy the cluster with --enable-ip-alias, --enable-private-nodes, --cluster-secondary-range-name=pod-range, and --services-secondary-range-name=svc-range, leaving the default ip-masq-agent configuration unchanged.This configuration delegates the Shared VPC IAM bindings and binds the cluster to the pre-defined secondary ranges properly, but places the Cloud NAT gateway in the service project (svc-proj-1) for only the primary range and relies on the default IP masquerade agent behavior.
host-proj) where the VPC network and subnets reside. A Cloud NAT gateway created in a service project cannot provide NAT for workloads attached to a Shared VPC subnet.ip-masq-agent settings unchanged causes the node to skip SNAT for all RFC 1918 addresses (10.0.0.0/8, 172.16.0.0/12, and 192.168.0.0/16). As a result, Pods retain their 10.40.0.0/14 source IP addresses when sending packets to 192.168.0.0/16, failing the requirement to masquerade traffic destined for the on-premises network.ip-masq-agent rules treat all RFC 1918 space as internal non-masquerade destinations.nonMasqueradeCIDRs customization, Pod CIDRs must be advertised and routable on-premises for return traffic to succeed.The Cloud NAT gateway were deployed in host-proj covering all IP ranges of gke-subnet, and ip-masq-agent were customized to include 10.0.0.0/8 while excluding 192.168.0.0/16.
host-proj, grant roles/container.hostServiceAgentUser on the project and roles/compute.networkUser on gke-subnet to the GKE service agent of svc-proj-1 (and roles/compute.networkUser on gke-subnet to its Google APIs service agent), enable Private Google Access on gke-subnet, and create a Public Cloud NAT gateway covering all IP ranges of gke-subnet. Create the cluster in svc-proj-1 with --enable-ip-alias, --enable-private-nodes, --cluster-secondary-range-name=pod-range, and --services-secondary-range-name=svc-range. Configure the ip-masq-agent ConfigMap with nonMasqueradeCIDRs set to 10.10.0.0/22, 10.40.0.0/14, and 10.0.0.0/8.This configuration combines Shared VPC IAM delegation, user-managed alias IP ranges, host-project Cloud NAT, and a customized IP masquerade agent (ip-masq-agent) policy to deploy an isolated, private VPC-native GKE cluster that selectively preserves Pod IP visibility inside Google Cloud while applying SNAT toward on-premises networks.
roles/container.hostServiceAgentUser) on host-proj and Compute Network User (roles/compute.networkUser) on gke-subnet to svc-proj-1's GKE service agent (along with Compute Network User for the Google APIs service agent) lets the service project attach nodes and alias IPs to gke-subnet. Specifying --cluster-secondary-range-name=pod-range and --services-secondary-range-name=svc-range binds the cluster to the host project's pre-defined ranges.gke-subnet allows private nodes to reach Artifact Registry and Google APIs internally. Creating a Public Cloud NAT gateway in host-proj (where the Shared VPC network lives) configured for all subnet ranges (primary, Pod, and Service ranges) enables outbound internet access for both nodes and Pods.ip-masq-agent skips SNAT for all RFC 1918 ranges, including 192.168.0.0/16. Explicitly setting nonMasqueradeCIDRs to 10.10.0.0/22, 10.40.0.0/14, and 10.0.0.0/8 while omitting 192.168.0.0/16 ensures Pod IPs remain visible to VPC resources in 10.0.0.0/8 and are masqueraded to node IPs when exiting to on-premises or the internet.Every network control plane resource (subnets, Private Google Access, Cloud NAT) resides in host-proj with least-privilege subnet-level bindings, while ip-masq-agent enforces precise boundary SNAT without requiring separate VPCs or Cloud VPN overlays.
host-proj, grant roles/compute.networkUser on gke-subnet to the GKE service agent of svc-proj-1, enable Private Google Access on gke-subnet, and create a Public Cloud NAT gateway covering all IP ranges of gke-subnet. Create the cluster in svc-proj-1 with --enable-ip-alias, --enable-private-nodes, --cluster-ipv4-cidr=10.40.0.0/14, and --services-ipv4-cidr=10.10.32.0/20. Configure the ip-masq-agent ConfigMap with nonMasqueradeCIDRs set to only 10.10.0.0/22 and 10.40.0.0/14.This configuration attempts to deploy a private VPC-native cluster into a Shared VPC subnet using CIDR-based flags (--cluster-ipv4-cidr and --services-ipv4-cidr), omits the roles/container.hostServiceAgentUser binding, and restricts nonMasqueradeCIDRs strictly to the cluster's own node and Pod ranges.
roles/compute.networkUser on gke-subnet is insufficient for GKE cluster creation in a Shared VPC. The service project's GKE service agent must also hold roles/container.hostServiceAgentUser on host-proj to perform network management operations (such as firewall and peering-related metadata operations) across projects.--cluster-ipv4-cidr and --services-ipv4-cidr instructs GKE to manage secondary ranges automatically. In a Shared VPC environment, GKE cannot create or manage secondary ranges; cluster creation must reference existing user-managed ranges using --cluster-secondary-range-name and --services-secondary-range-name.nonMasqueradeCIDRs to only 10.10.0.0/22 and 10.40.0.0/14 omits the wider 10.0.0.0/8 Shared VPC space. Consequently, Pods communicating with other Compute Engine VMs in shared-net are masqueraded behind node IPs instead of preserving their Pod source IP addresses.roles/container.hostServiceAgentUser triggers permission errors such as GCE_PERMISSION_DENIED during cluster provisioning.nonMasqueradeCIDRs to only node and Pod ranges emulates an island-mode network across the entire VPC.roles/container.hostServiceAgentUser were granted in host-proj, --cluster-secondary-range-name and --services-secondary-range-name were used instead of CIDR flags, and 10.0.0.0/8 were included in nonMasqueradeCIDRs.
host-proj, grant roles/container.hostServiceAgentUser on the project and roles/compute.networkUser on gke-subnet to the GKE service agent of svc-proj-1, enable Private Google Access on gke-subnet, and create a Public Cloud NAT gateway covering only the primary range (10.10.0.0/22) of gke-subnet. Create the cluster in svc-proj-1 with --enable-ip-alias, --enable-private-nodes, --disable-default-snat, --cluster-secondary-range-name=pod-range, and --services-secondary-range-name=svc-range. Configure ip-masq-agent with nonMasqueradeCIDRs set to 10.0.0.0/8 and 192.168.0.0/16.This configuration sets up the Shared VPC IAM roles and user-managed secondary range names correctly, but combines --disable-default-snat with a primary-range-only Cloud NAT gateway in host-proj and explicitly adds 192.168.0.0/16 to nonMasqueradeCIDRs.
192.168.0.0/16 in nonMasqueradeCIDRs instructs ip-masq-agent not to masquerade Pod traffic bound for the on-premises network. This directly violates the requirement to hide Pod IP addresses behind node IP addresses when sending egress traffic to 192.168.0.0/16.10.10.0.0/22) while disabling default SNAT (--disable-default-snat) prevents Pods from translating their 10.40.0.0/14 source addresses at either the node or Cloud NAT layer, breaking outbound internet connectivity.nonMasqueradeCIDRs bypass node-level SNAT and retain original Pod source IP addresses.--disable-default-snat disables GKE's built-in masquerading of external traffic and requires Cloud NAT to explicitly cover the Pod secondary IP range (or custom ip-masq-agent rules) if internet access is needed.Cloud NAT in host-proj covered all IP ranges of gke-subnet, --disable-default-snat were omitted, and 192.168.0.0/16 were excluded from nonMasqueradeCIDRs.
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