<p>The <a href="https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale" rel="nofollow noreferrer">docs</a> says:</p>
<blockquote>
<p>For per-pod resource metrics (like CPU), the controller fetches the metrics from the resource metrics API for each Pod targeted by the HorizontalPodAutoscaler. Then, if a target utilization value is set, the controller calculates the utilization value as a percentage of the equivalent <strong>resource request</strong> on the containers in each Pod. If a target raw value is set, the raw metric values are used directly. The controller then takes the mean of the utilization or the raw value (depending on the type of target specified) across all targeted Pods, and produces a ratio used to scale the number of desired replicas.</p>
</blockquote>
<p>Assume I have a Pod with:</p>
<pre><code>        resources:
          limits:
            cpu: &quot;0.3&quot;
            memory: 500M
          requests:
            cpu: &quot;0.01&quot;
            memory: 40M
</code></pre>
<p>and now I have an autoscaling definition as:</p>
<pre><code>type: Resource
resource:
  name: cpu
  target:
    type: Utilization
    averageUtilization: 60
</code></pre>
<p>Which according to the docs:</p>
<blockquote>
<p>With this metric the HPA controller will keep the average utilization of the pods in the scaling target at 60%. Utilization is the ratio between the current usage of resource to the <strong>requested</strong> resources of the pod</p>
</blockquote>
<p>So, I'm not understanding something here. If <code>request</code> is the minimum resources required to run the app, how would scaling be based on this value? 60% of 0.01 is nothing, and the service would be constantly scaling.</p>

<p>Your misunderstanding might be that the value of <code>request</code> is not necessarily the minimum your app need to run.</p>
<p>It is what you (the developer, admin, DevOps) request from the Kubernetes cluster for a pod in your application to run and it helps the scheduler to pick the right node for your workload (say the in one that has sufficient resources available). So, don't pick this value too small or too high.</p>
<p>Apart from that, autoscaling works as you described it. In this case, the cluster calculates how much of your requested CPU is used and will scale out when more than 60% are in use. Keep in mind, that Kubernetes does not look at every single pod but on the average of all pods in that group.</p>
<p>For example, given two pods running, one pod could run on 100% of requests and the other one at (almost) 0%. The average would be around 50% so no autoscaling happens in the case of the Horizontal Pod Autoscaler.</p>
<p>In production, I personally try to do a guess on the right values and then look at the metrics and adjust the values to my real-world workload. Prometheus is your friend or at least the metrics server:</p>
<p><a href="https://github.com/prometheus-operator/kube-prometheus" rel="noreferrer">https://github.com/prometheus-operator/kube-prometheus</a>
<a href="https://github.com/kubernetes-sigs/metrics-server" rel="noreferrer">https://github.com/kubernetes-sigs/metrics-server</a></p>
