Prepare and test your skills

Prepare and test your skills

Free sample question with answers and detailed explanation below. The Professional Cloud Developer practice bank has an additional 608 practice questions.Try 10 free realistic questions: instant score, no credit card, and no account required.
Your team runs a microservices application on Google Kubernetes Engine (GKE) with Cloud Service Mesh enabled. You are preparing to release version v2 of the checkout service using a canary deployment pattern and must meet these requirements:
v2 and 95% to v1, independent of Pod replica counts.v1 and v2.v1 immediately if errors spike, without waiting for Pods to scale down.How should you configure traffic management on GKE?
Service whose selector matches both v1 and v2 Deployments without version subsets, and scale v1 to 19 Pods and v2 to 1 Pod to achieve the 95/5 split.Using a standard Kubernetes Service without a service mesh or Gateway API relies on kube-proxy (or eBPF dataplane) to distribute traffic evenly across all ready Pod endpoints matching the Service's label selector. To approximate a canary percentage, operators must manually adjust the replica count ratio between the stable and canary Deployments.
v1 normally runs fewer replicas, and still yields an inexact traffic split because connection-level load balancing does not guarantee exact HTTP request percentages.v1 from v2 in Layer 7 service metrics like per-version HTTP error rates and latency.v2 down to zero or modifying Deployment/Service labels and waiting for endpoints to drain.You were deploying to a GKE cluster without Cloud Service Mesh or Gateway API installed, did not require exact HTTP traffic percentages, and only needed a rough pod-proportion canary rollout.
Even when automated with tools like Cloud Deploy service-based networking, pod-count canary strategies calculate percentages based on replica math rather than actual request weights, making them unsuitable when exact traffic percentages and rapid Layer 7 rollbacks are required.
Service of type LoadBalancer with externalTrafficPolicy: Local and the networking.gke.io/weighted-load-balancing: pods-per-node annotation to distribute 5% of connections to v2.In GKE, weighted load balancing (networking.gke.io/weighted-load-balancing: pods-per-node) is an annotation applied to a regional external passthrough Network Load Balancer (LoadBalancer Service) paired with externalTrafficPolicy: Local. Its purpose is to distribute incoming Layer 4 connections across GKE nodes proportionally to the number of healthy Pods scheduled on each node.
v1 vs. v2) and cannot assign arbitrary percentage weights like 95% and 5%.v1 and v2.spec.loadBalancerClass: networking.gke.io/l4-regional-external and externalTrafficPolicy: Local.You were troubleshooting uneven CPU or network utilization across GKE nodes behind an external passthrough Network Load Balancer because some nodes hosted more Pods than others.
Students often confuse the term weighted load balancing with weighted traffic splitting. In GKE networking, pods-per-node weighted load balancing refers to node capacity balancing at Layer 4, whereas version-based canary routing requires Layer 7 constructs such as Cloud Service Mesh VirtualService or Gateway API HTTPRoute.
v1 and v2 as separate Kubernetes Deployments with distinct version labels (version: v1 and version: v2) behind a single Kubernetes Service with named ports. Create an Istio DestinationRule defining v1 and v2 subsets, and configure a VirtualService with traffic weights of 95 and 5.Cloud Service Mesh (formerly Anthos Service Mesh) uses Istio traffic management resources—specifically DestinationRule and VirtualService—to control Layer 7 (HTTP/gRPC) routing between different versions of a microservice via sidecar Envoy proxies. By decoupling traffic routing from Kubernetes Pod replica counts, a service mesh enables precise canary deployments and instant rollbacks.
DestinationRule maps Pod labels (version: v1 and version: v2) into named subsets, while a VirtualService assigns explicit weight percentages (95 to v1 and 5 to v2). Envoy proxies enforce this split at the request level regardless of how many Pods each Deployment runs.VirtualService manifest to send 100 weight back to the v1 subset redirects all live requests within seconds, without waiting for v2 Pods to terminate.name: http) and Deployment labels rather than application code modifications.v2 Pods in the cluster) from release (shifting user traffic to v2).VirtualService weights.Unlike native Kubernetes Services that round-robin traffic across all matching endpoints, Cloud Service Mesh operates at Layer 7, delivering exact weighted routing, instant rollbacks, and built-in versioned telemetry in a single declarative workflow.
v1 and v2 Deployments and apply a Kubernetes NetworkPolicy using Pod label selectors to restrict 95% of ingress traffic to v1 and 5% to v2.A Kubernetes NetworkPolicy is a Layer 3/Layer 4 security firewall resource that controls which Pods are allowed to communicate with each other or with external IP CIDR blocks. Using podSelector and namespaceSelector rules, administrators define binary allow-or-deny rules for ingress and egress network connections.
NetworkPolicy resources only permit or drop packets; they have no capability to split HTTP requests by percentage weights such as 95% and 5%.v2 would simply drop packets destined for v2 Pods—causing failed requests for clients routed to those endpoints—rather than cleanly redirecting traffic back to v1.Your goal was to isolate workloads—for example, preventing Pods in a development namespace from reaching a production database namespace or restricting access to sensitive internal services.
While both NetworkPolicy and Cloud Service Mesh use Kubernetes Pod labels, they serve completely different roles: NetworkPolicy enforces L4 network boundaries, whereas Cloud Service Mesh DestinationRule and VirtualService manage L7 traffic routing, canary rollouts, and observability.
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