<p>I am working on a project where we want to test an autoscaling algorithm which involves making a few changes to the default horizontal pod autoscaling algorithm on Kubernetes. Where should we make changes in the <a href="https://github.com/kubernetes/autoscaler/tree/master/cluster-autoscaler" rel="nofollow noreferrer">https://github.com/kubernetes/autoscaler/tree/master/cluster-autoscaler</a> repo so that we can test our algorithm?</p>

Darshan Venkatesh
<p>The Cluster-Autoscaler is pretty much a cluster auto scaling version which will scale the number of Nodes, in case any of below happens.</p>

<blockquote>
  <ul>
  <li>there are pods that failed to run in the cluster due to insufficient    resources</li>
  <li>there are nodes in the cluster that have been    underutilized for an extended period of time and their pods can be    placed on other
  existing nodes.</li>
  </ul>
</blockquote>

<p>If you want a custom pod scaling algorithm, I would recommend doing it as a simple service that does just that and not to alter the Cluster Autoscaler. Here's a similar solution to your problem.</p>

<p><a href="https://stackoverflow.com/a/58447811/5617140">https://stackoverflow.com/a/58447811/5617140</a></p>

<p>You can alter the service logic to suit your requirements. And it is probably a  good idea to use Kubernetes API to achieve scaling tasks.</p>
