<p>Say we have the following deployment:</p>

<pre><code>apiVersion: apps/v1
kind: Deployment
metadata:
  ...
spec:
  replicas: 2
  template:
    spec:
      containers:
        - image: ...
          ...
          resources:
            requests:
              cpu: 100m
              memory: 50Mi
            limits:
              cpu: 500m
              memory: 300Mi
</code></pre>

<p>And we also create a <code>HorizontalPodAutoscaler</code> object which automatically scales up/down the number of pods based on CPU average utilization. I know that the HPA will compute the number of pods based on the resource <strong>requests</strong>, but what if I want the containers to be able to request more resources before scaling horizontally?</p>

<p>I have two questions:</p>

<p>1) Are resource <strong>limits</strong> even used by K8s when a HPA is defined?</p>

<p>2) Can I tell the HPA to scale based on resource <strong>limits</strong> rather than requests? Or as a means of implementing such a control, can I set the <code>targetUtilization</code> value to be more than 100%?</p>

mittelmania
<p>No, HPA is not looking at limits at all. You can specify target utilization to any value even higher than 100%. </p>
