You deployed a Deployment with three replicas on GKE. The container spec does not include any CPU requests or limits. You created a Horizontal Pod Autoscaler that should increase replicas from 3 up to 10 when average CPU utilization exceeds 70 %. During a stress test, Cloud Monitoring shows each Pod constantly using about 600 mCPU, yet the HPA never scales beyond three replicas. Which change will allow the HPA to scale the workload based on CPU usage?
Define an explicit, non-zero CPU request (and optional limit) for the container in the Deployment spec.
Install the Ops Agent as a DaemonSet so the HPA can read CPU metrics from Cloud Monitoring.
Modify the HPA to use a custom metric instead of the default CPU utilization metric.
Enable node-pool cluster autoscaling so that new Pods have capacity to schedule.
The HPA calculates CPU utilization as a percentage of the CPU request set in each container spec. When no CPU request is defined, Kubernetes treats the request as 0, so the utilization cannot be computed and the HPA remains inactive. Adding an explicit, non-zero CPU request (and optionally a limit) lets the metrics server report meaningful utilization percentages, enabling the HPA to compare the observed value with the 70 % target and create additional replicas as needed. Enabling cluster autoscaling only adds nodes after the HPA creates Pods, switching to a custom metric does not solve the missing request, and installing the Ops Agent is unnecessary because resource metrics already come from the metrics-server.
Ask Bash
Bash is our AI bot, trained to help you pass your exam. AI Generated Content may display inaccurate information, always double-check anything important.
What is a Horizontal Pod Autoscaler (HPA) in Kubernetes?
Open an interactive chat with Bash
Why does the CPU request affect HPA scaling in Kubernetes?
Open an interactive chat with Bash
What is the difference between a CPU request and a CPU limit in Kubernetes?
Open an interactive chat with Bash
What is a Horizontal Pod Autoscaler (HPA)?
Open an interactive chat with Bash
What happens if no CPU requests or limits are set for a container?
Open an interactive chat with Bash
How does the metrics-server interact with the HPA?
Open an interactive chat with Bash
GCP Associate Cloud Engineer
Ensuring successful operation of a cloud solution
Your Score:
Report Issue
Bash, the Crucial Exams Chat Bot
AI Bot
Loading...
Loading...
Loading...
Pass with Confidence.
IT & Cybersecurity Package
You have hit the limits of our free tier, become a Premium Member today for unlimited access.
Military, Healthcare worker, Gov. employee or Teacher? See if you qualify for a Community Discount.
Monthly
$19.99 $11.99
$11.99/mo
Billed monthly, Cancel any time.
$19.99 after promotion ends
3 Month Pass
$44.99 $26.99
$8.99/mo
One time purchase of $26.99, Does not auto-renew.
$44.99 after promotion ends
Save $18!
MOST POPULAR
Annual Pass
$119.99 $71.99
$5.99/mo
One time purchase of $71.99, Does not auto-renew.
$119.99 after promotion ends
Save $48!
BEST DEAL
Lifetime Pass
$189.99 $113.99
One time purchase, Good for life.
Save $76!
What You Get
All IT & Cybersecurity Package plans include the following perks and exams .