<p>I'm new to <strong>Kubernetes</strong>, and I have a doubt about <strong>horizontal pod autoscaling</strong>. Can I apply HPA with just one node ? If so, what are the benefits of HPA using one node only ?</p>
<p>If I use the metrics below, the target says <code>averageUtilization</code> 50% of cpu. Does that imply that I need a new node after the value is reached ?</p>
<pre><code>metrics:
  - type: Resource
    resource:
      name: cpu
      target:
        type: Utilization
        averageUtilization: 50
</code></pre>
<p>Any advice ?</p>

<p>Here are some notes that might help you to sort things out:</p>
<p>Yes, you can use horizontal pod autoscaling on one node only.</p>
<p>The benefit of running multiple pods is parallelism: More instances of your app can handle more load - in that regard it doesn't matter if you run the pods on one or several nodes.</p>
<p>But if you have more pods of your application, you might end up in a situation where you need additional nodes to handle the load.</p>
<p>To determine out how many pods can run on one node, kubernetes uses the concept of <a href="https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/" rel="nofollow noreferrer">resource limits and requests</a>.</p>
<p>HPA will spawn new pods if the actual utilization of your pod hits the target utilization - but it doesn't take care that your node can handle more pods - you need to configure this using resource limits and requests.</p>
<p>Scaling up the nodes of your cluster is not handled by HPA, you need to use the <a href="https://github.com/kubernetes/autoscaler/tree/master/cluster-autoscaler" rel="nofollow noreferrer">kubernetes cluster autoscaler</a> for that.</p>
