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.
You are deploying a stateless web API on Google Kubernetes Engine (GKE) that requires Horizontal Pod Autoscaler (HPA) scaling based on percentage CPU and memory utilization. Load testing indicates the following workload requirements:
250m CPU and 512Mi memory.30% over two minutes, and you want to maintain a 10% CPU safety buffer below full utilization while new replicas start.Which Pod resource and HPA configuration should you deploy?
requests.cpu and limits.cpu both to "250m", and set requests.memory: "512Mi" with no memory limit. Configure an autoscaling/v2 HPA using type: Resource with target.type: Utilization and averageUtilization: 69 for CPU and 80 for memory.Setting limits.cpu equal to requests.cpu (250m) places a hard ceiling on CPU cycles via Linux CFS quotas, while setting requests.memory without limits.memory gives the Pod Burstable memory behavior, allowing it to consume memory above 512Mi whenever node memory is free.
limits.cpu at 250m prevents the container from using idle CPU cycles on the node during a 30% traffic spike. Even if the node has plenty of spare CPU, the container is throttled, increasing request latency.512Mi memory request causes it to become vulnerable to abrupt kubelet eviction or OOMKilled termination as soon as node memory pressure occurs.Guaranteed memory Pods during memory contention.There were a strict requirement for Guaranteed QoS on CPU (such as isolated CPU core pinning for specialized workloads) alongside a stateless batch workload that can safely tolerate memory-pressure evictions.
For cost-optimized, resilient GKE serving workloads, the recommended pattern is the inverse: match memory requests and limits to prevent unexpected evictions, and leave CPU limits unbounded so workloads can burst smoothly while HPA provisions additional replicas.
resources.requests and resources.limits from the Pod specification to allow unrestricted scaling, and configure an autoscaling/v2 HPA using type: Resource with target.type: Utilization and averageUtilization: 69 for both CPU and memory.When a Pod specification omits both resources.requests and resources.limits, Kubernetes assigns the Pod to the BestEffort Quality of Service (QoS) class. The scheduler places the Pod without reserving guaranteed CPU or memory, and the container can consume any unallocated node capacity.
Utilization as a percentage of requested resources (current usage / request). Without resources.requests defined for CPU and memory, HPA cannot compute utilization percentages and will fail to scale on target.type: Utilization.BestEffort Pods are the first candidates terminated by the kubelet when a node experiences memory pressure, resulting in abrupt application outages.AverageValue such as milliCPUs or MiB) rather than percentage Utilization.BestEffort Pods have no resource guarantees during node starvation events.You were only running non-critical batch jobs without percentage-based HPA, or if you were scaling solely on absolute resource metrics (target.type: AverageValue) or external queue-depth metrics.
Even when using GKE Autopilot, which automatically injects default requests if omitted, relying on defaults instead of load-tested baselines (250m CPU and 512Mi memory) leads to miscalculated HPA scaling thresholds.
requests.cpu: "250m" with no CPU limit, and set both requests.memory and limits.memory to "512Mi". Configure an autoscaling/v2 HPA using type: Resource with target.type: Utilization and averageUtilization: 69 for CPU and 80 for memory.In Kubernetes and GKE, container resource requests (spec.containers[].resources.requests) define the guaranteed baseline capacity used by the scheduler for Pod placement and by the Horizontal Pod Autoscaler (HPA) to compute percentage utilization. Resource limits (spec.containers[].resources.limits) enforce upper bounds on container consumption.
requests.cpu (250m) and requests.memory (512Mi) gives the autoscaling/v2 HPA controller the denominator needed to evaluate target.type: Utilization percentages.requests.memory equal to limits.memory (512Mi) ensures the container cannot allocate unreserved memory on the node and avoids unexpected OOMKilled evictions during node memory pressure.limits.cpu unbounded allows Pods to burst into unused node CPU capacity during spikes rather than being throttled at 250m.(1 - buff) / (1 + perc) with a 10% safety buffer (0.1) and 30% expected growth (0.3) yields (1 - 0.1) / (1 + 0.3) = 0.69, or 69% target CPU utilization, while an 80% memory threshold triggers scale-out before approaching the 512Mi cap.69% reserves enough capacity to absorb incoming traffic while new Pods pull images or nodes provision.This configuration pairs GKE resource sizing best practices (equal memory request/limit and unbounded CPU limit) with a mathematically tuned HPA utilization threshold, delivering maximum stability during bursts without overprovisioning.
requests.cpu: "250m" with no CPU limit, and set both requests.memory and limits.memory to "512Mi". Configure an autoscaling/v2 HPA with averageUtilization: 100 for CPU and 95 for memory, and enable a Vertical Pod Autoscaler (VPA) in Auto mode for both CPU and memory.Auto mode doSetting HPA averageUtilization to 100 instructs the autoscaler not to add replicas until average Pod CPU usage reaches 100% of the 250m request. Enabling Vertical Pod Autoscaler (VPA) in Auto mode continuously observes resource usage and recreates Pods with updated CPU and memory requests.
averageUtilization: 100 CPU target leaves zero headroom for the 30% traffic growth and 10% safety buffer. At 100% CPU, request processing latency degrades sharply while waiting for new Pods and nodes to spin up.Auto mode modifies the exact CPU and memory requests that HPA uses to compute utilization percentages. When VPA increases a Pod's CPU request, its utilization percentage drops, causing HPA to scale down replicas and triggering oscillating, unstable scaling behavior.Auto mode deletes and recreates Pods to apply new resource requests, which is unsuitable for handling sudden traffic spikes.100% CPU utilization before scaling fails to account for the two-to-three-minute window needed to start Pods or provision nodes.Off (recommendation) mode.You configured VPA in Off (recommendation) mode solely to inspect baseline sizing suggestions, and lowered the HPA CPU averageUtilization target to 69 without running VPA Auto mode on the same metric.
To combine horizontal and vertical scaling safely on GKE, either keep VPA in Off mode, scale HPA on custom/external metrics (such as requests per second) while VPA manages CPU/memory, or use Multidimensional Pod Autoscaling (MPA).
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