The HPA was unable to compute the replica count: missing request for cpu on container

Solution Verified - Updated -

Issue

  • After configuring the autoscaling for CPU (through oc autoscale command) the pods are not getting autoscaled
  • The metrics-server is installed and running but, even this way, the HPA is not working in OCP 3.11 or OCP 4.x
  • The events of the hpa show:
  ScalingActive  False   FailedGetResourceMetric  the HPA was unable to compute the replica count: missing request for cpu on container <container> in pod <pod>              

Environment

  • Red Hat OpenShift Container Platform
    • 3.11
    • 4.x

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content