Google ACE Deploying and Implementing a Cloud Solution Practice Question
You are deploying a high-traffic web application on GKE. You need to automatically scale the number of pods based on CPU utilization. Which THREE steps are required to set up Horizontal Pod Autoscaling (HPA)?
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
Install the metrics-server in the cluster.
To use HPA, you need a deployment (or other scalable resource), you need to apply the HPA resource (e.g., via kubectl autoscale), and you must have metrics-server installed to provide metrics. Creating a service is optional.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✓
Install the metrics-server in the cluster.
Why this is correct
The metrics-server aggregates CPU and memory usage from kubelets via the Summary API and exposes them through the metrics.k8s.io API. The HorizontalPodAutoscaler (HPA) controller repeatedly queries that API to obtain current resource utilization; if no metrics-server is installed, the metrics API is unavailable and the HPA reports 'unable to retrieve metrics' and does not scale. It is the lightweight, cluster-local component that provides the raw numbers the HPA needs, whereas GCP's monitoring service is not directly consulted by the HPA.
- ✗
Enable Stackdriver Monitoring for the cluster.
Why it's wrong here
Stackdriver Monitoring (now Cloud Monitoring) is an external Google Cloud service used for dashboards, alerts, and long-term metric retention. Enabling it does not register the metrics.k8s.io API aggregator in your cluster, so the HPA controller will still fail to fetch the live per-pod resource samples it requires. While Stackdriver can display HPA-related telemetry, it is neither a prerequisite nor a substitute for the in-cluster metrics-server, and the HPA cannot query it as its source of truth.
- ✓
Create a HorizontalPodAutoscaler resource (e.g., via kubectl autoscale).
Why this is correct
Creating a HorizontalPodAutoscaler resource is the declaration of your scaling policy: it specifies the target workload (e.g., a Deployment), the target CPU utilization percentage, and the min/max replica count. The HPA controller periodically computes the desired replica count using the formula ceil(currentReplicas * (currentMetric / targetMetric)) and updates the Deployment's scale subresource accordingly. Without this resource, GKE has no scaling rules to apply even if metrics-server and resource requests are present.
- ✓
Create a Deployment with resource requests for CPU.
Why this is correct
The HPA calculates utilization as the ratio of measured CPU usage to the sum of the CPU requests across the pods in the Deployment. If pods do not declare a CPU request, the HPA controller cannot compute a utilization percentage and marks the metric as 'unknown', leaving the autoscaler permanently inactive. Specifying requests for CPU (and optionally memory) is therefore a hard dependency for CPU-based autoscaling, as it establishes the denominator for the target utilization calculation.
- ✗
Expose the Deployment as a Service of type LoadBalancer.
Why it's wrong here
Exposing the Deployment as a Service of type LoadBalancer provisions a Google Cloud load balancer and external IP for ingress traffic, which is a networking concern entirely orthogonal to autoscaling. The HorizontalPodAutoscaler operates on the Deployment's scale subresource and never inspects Service type or load balancer health; it scales based purely on resource metrics reported through the metrics API. You can have HPA working on a ClusterIP or even an unexposed Deployment, and adding a LoadBalancer will neither enable nor accelerate scaling.
Go deeper
Related to this question
Learn chapter
Deployment Manager and Terraform on GCP
Key term
Service
A service is a software component or system that performs a specific function and is available to be used by other programs or users over a network.
Key term
GKE
GKE is Google's managed Kubernetes service that automates deploying, scaling, and managing containerized applications in the cloud.
About these practice questions
Courseiva writes every ACE question from scratch — 769 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or dumps. Learn why practice questions differ from exam dumps →
JA
Written by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
This ACE practice question is part of Courseiva's free Google Cloud certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the ACE exam.