Skip to content

Professional Cloud Network Engineer · Domain 2: Implementing a VPC network · 20% of the exam

Task 2.4: Configuring and maintaining GKE clusters.

VPC-native clusters, clusters in Shared VPC, private control plane access with authorized networks and the DNS-based endpoint, GKE Dataplane V2, IP masquerade, network policies, Pod and Service ranges with additional Pod ranges, and cluster DNS.

Study it

  • GKE cluster networking: VPC-native clusters, private control plane access, Dataplane V2, network policies, IP masquerade and DNS

    Partly covered by: Services & Ingress

Sample questions

Try each one before opening the answer. Every option is explained, with the Google Cloud documentation page that proves it.

Question 1 · choose 1

A new GKE Standard cluster must meet three requirements: Pod addresses reachable from a peered VPC network without any extra route exchange settings, Pod ranges learned by the data center through the existing Cloud Router without per-node routes, and container-native load balancing with network endpoint groups. How should the cluster's networking be set up?

  1. AA routes-based cluster, with custom route export turned on for the peering and the Pod CIDR advertised by the Cloud Router
  2. BA VPC-native cluster whose Pods and Services use secondary IP address ranges of the node subnet
  3. CA VPC-native cluster plus a custom static route per node for its Pod range, exported over the peering
  4. DA routes-based cluster that takes its Pod range from a secondary range of the node subnet
Show the answer and why
  • AA routes-based cluster, with custom route export turned on for the peering and the Pod CIDR advertised by the Cloud Router

    Incorrect

    Routes-based Pod routing relies on custom static routes, needs the peering's custom route settings, and NEGs work only with VPC-native clusters.

  • BA VPC-native cluster whose Pods and Services use secondary IP address ranges of the node subnet

    Correct

    Pod alias ranges are subnet routes: natively routable over peering, advertised by Cloud Router like other secondary ranges, and required for NEGs.

  • CA VPC-native cluster plus a custom static route per node for its Pod range, exported over the peering

    Incorrect

    VPC-native Pod ranges don't depend on custom static routes; per-node routes are what the requirements want to avoid.

  • DA routes-based cluster that takes its Pod range from a secondary range of the node subnet

    Incorrect

    Using secondary ranges for Pods is what makes a cluster VPC-native; a routes-based cluster uses custom static routes instead.

In a VPC-native cluster, Pod and Service addresses come from subnet secondary ranges (alias IP ranges). Their subnet routes are always exchanged over VPC Network Peering, Cloud Routers can advertise them to hybrid networks, they consume no static route quota, and features such as network endpoint groups require them. VPC-native is the default network mode for new clusters.

Question 2 · choose 1

A GKE cluster was created with --enable-dns-access, and engineers already reach its control plane through the DNS-based endpoint with their usual gcloud credentials. A third-party CI system outside Google Cloud has no Google credentials; it presents a Kubernetes ServiceAccount bearer token to the same endpoint, and its requests are rejected as unauthenticated. Which update should the network engineer apply to the cluster?

  1. A--enable-k8s-certs-via-dns
  2. B--master-authorized-networks with the CI system's egress address
  3. C--enable-master-global-access
  4. D--enable-k8s-tokens-via-dns
Show the answer and why
  • A--enable-k8s-certs-via-dns

    Incorrect

    This flag enables Kubernetes X.509 client certificates on the DNS-based endpoint, not ServiceAccount bearer tokens.

  • B--master-authorized-networks with the CI system's egress address

    Incorrect

    Authorized networks restrict the IP-based endpoints; the CI requests fail at authentication, not at an address check.

  • C--enable-master-global-access

    Incorrect

    This flag lets internal addresses in other Google Cloud regions reach the IP-based internal endpoint; it changes nothing about token authentication.

  • D--enable-k8s-tokens-via-dns

    Correct

    This flag enables authentication to the DNS-based endpoint with Kubernetes ServiceAccount bearer tokens, which is off by default.

Kubernetes ServiceAccount bearer tokens and X.509 client certificates are disabled by default on the DNS-based endpoint. Each is enabled separately, with --enable-k8s-tokens-via-dns or --enable-k8s-certs-via-dns. Google recommends using them only when a client needs them, because they add management overhead.

Question 3 · choose 1

In a GKE Standard cluster with network policy enforcement, Pods in the payments namespace use Workload Identity Federation for GKE to call Google Cloud APIs. The team applies a NetworkPolicy that denies all egress from the namespace except to the database subnet through an ipBlock rule. Database queries keep working, but the Pods' client libraries can no longer obtain Google Cloud credentials. What must the policy also allow?

  1. AIngress to the Pods from the kube-system namespace
  2. BEgress from the payments Pods to the GKE metadata server
  3. CEgress from the payments Pods to the cluster's control plane endpoint
  4. DIngress to the payments Pods from the node IP range through an ipBlock rule
Show the answer and why
  • AIngress to the Pods from the kube-system namespace

    Incorrect

    The credential requests leave the Pods; an ingress rule doesn't open the egress path they need.

  • BEgress from the payments Pods to the GKE metadata server

    Correct

    With network policy and Workload Identity Federation for GKE, egress to the metadata server must be allowed, because the credentials come from it.

  • CEgress from the payments Pods to the cluster's control plane endpoint

    Incorrect

    The Pods' Google Cloud credentials come from the metadata server, not from the Kubernetes API server.

  • DIngress to the payments Pods from the node IP range through an ipBlock rule

    Incorrect

    Opening ingress from the nodes doesn't let the Pods send their requests out to the metadata server.

GKE's network policy page lists the requirement directly: when you use network policy with Workload Identity Federation for GKE, you must allow egress to the metadata server. A default-deny egress policy that allows only the database cuts the Pods off from the credentials they need.

Question 4 · choose 1

A build tool connects to a GKE control plane without the gcloud CLI. Through the cluster's DNS-based endpoint it validates the server certificate with its normal trust store; through the IP-based endpoint the TLS handshake fails certificate validation. What explains the difference?

  1. AThe DNS-based endpoint uses a public Google CA; IP-based endpoints use the cluster root CA
  2. BThe IP-based endpoints don't use TLS, so there's no certificate to validate
  3. CThe IP-based endpoint's certificate expires daily and must be refreshed with each connection
  4. DBoth endpoints present the same certificate, but authorized networks block the handshake on the IP-based endpoint
Show the answer and why
  • AThe DNS-based endpoint uses a public Google CA; IP-based endpoints use the cluster root CA

    Correct

    For IP-based endpoints the client must use the cluster root CA's public certificate, for example in its kubeconfig file.

  • BThe IP-based endpoints don't use TLS, so there's no certificate to validate

    Incorrect

    Connections to both kinds of endpoint are protected by TLS.

  • CThe IP-based endpoint's certificate expires daily and must be refreshed with each connection

    Incorrect

    The difference is the signing CA, not a short certificate lifetime.

  • DBoth endpoints present the same certificate, but authorized networks block the handshake on the IP-based endpoint

    Incorrect

    Authorized networks filter by source address; they don't cause certificate validation errors.

On the DNS-based endpoint, the Google Front End presents a certificate signed by a public, generally recognized Google CA. On IP-based endpoints the Kubernetes API server presents a certificate signed by the cluster root CA, so clients without the gcloud CLI must add that root CA certificate to their kubeconfig.

Question 5 · choose 1

A GKE Standard cluster uses the default maximum of 110 Pods per node, and its Pod secondary range is a /19. Ignoring other limits, how many nodes can the cluster have before the Pod range runs out?

  1. A8 nodes
  2. B74 nodes
  3. C32 nodes
  4. D64 nodes
Show the answer and why
  • A8 nodes

    Incorrect

    Eight nodes would match a /21 Pod range with /24 blocks per node.

  • B74 nodes

    Incorrect

    This divides the range's 8,192 addresses by 110 Pods; each node takes a whole /24 block of 256 addresses.

  • C32 nodes

    Correct

    110 Pods per node gives each node a /24, and a /19 holds 2^(24-19) = 32 such blocks.

  • D64 nodes

    Incorrect

    64 would need /25 blocks per node, which fit at most 64 Pods.

GKE assigns each node a Pod CIDR block based on the maximum Pods per node: 110 Pods take a /24. The number of nodes the Pod range supports is 2^(node block prefix - Pod range prefix), here 2^(24 - 19) = 32.

Question 6 · choose 1

A team running GKE Autopilot clusters wants to turn off NodeLocal DNSCache to simplify troubleshooting of DNS lookups. What should the network engineer tell the team?

  1. AIt can be disabled per node pool in Autopilot clusters
  2. BIt's enabled by default in Autopilot clusters and can't be disabled
  3. CAutopilot clusters don't run NodeLocal DNSCache, so there is nothing to disable
  4. DIt can be disabled by switching the cluster to Cloud DNS for GKE
Show the answer and why
  • AIt can be disabled per node pool in Autopilot clusters

    Incorrect

    In Autopilot clusters the add-on can't be disabled at all.

  • BIt's enabled by default in Autopilot clusters and can't be disabled

    Correct

    The NodeLocal DNSCache page states this for Autopilot clusters.

  • CAutopilot clusters don't run NodeLocal DNSCache, so there is nothing to disable

    Incorrect

    Autopilot clusters run it by default.

  • DIt can be disabled by switching the cluster to Cloud DNS for GKE

    Incorrect

    NodeLocal DNSCache caches in front of the cluster's DNS provider, kube-dns or Cloud DNS for GKE; the provider choice doesn't remove it.

NodeLocal DNSCache runs a DNS cache on each node as a DaemonSet, so Pods' lookups go to the local cache first, which lowers latency and the load on kube-dns or Cloud DNS for GKE. Autopilot clusters always have it enabled; recent Standard clusters enable it by default but allow disabling it.

Practice domain 2 →Practice all domains →