<p>Is it possible to attach Cluster Autoscaler (CA) on baremetal kubernetes cluster?
(want to scale in/out via AWS EC2)</p>
<p>I did checked
<a href="https://github.com/kubernetes/autoscaler/issues/1060" rel="nofollow noreferrer">https://github.com/kubernetes/autoscaler/issues/1060</a>
document but I couldn't find the answer I wanted.</p>
<p>logically, it seems possible but I am not sure I can use this feature.</p>

Kyroo0
<p>This is a little bit complicated for the simple reason that your typical cloud based k8s instances are virtual machines which are managed through a simple API. This allows k8s to easily integrate with cloud providers and manage autoscaling simply by issuing API calls to your provider.</p>
<p>With a bare metal setup it is tricky, since you need a way to be able to communicate with your bare metal nodes that is k8s native. <a href="https://github.com/kubernetes/autoscaler/issues/953#issuecomment-396583127" rel="nofollow noreferrer">Here</a> is a complicated version of what your solution will look like.</p>
<p>Alternatively, what you can do is use the <code>metal3</code> project. You will supply <code>--cloud-provider cluster-api</code> to your autoscaler( see <a href="https://github.com/kubernetes/autoscaler/tree/master/cluster-autoscaler/cloudprovider/clusterapi" rel="nofollow noreferrer">this</a> doc). You will then run <code>cluster-api-provider-m3</code> in your cluster, along with <code>baremetal-operator</code>. This will allow you to manage your bare metal instances as k8s objects, which are manipulated using the cluster-api provider, which is what your autoscaler will engage with.</p>
<p>Here's some information on <a href="https://metal3.io/" rel="nofollow noreferrer">metal3</a> project. <a href="https://metal3.io/try-it.html" rel="nofollow noreferrer">Here</a> is a guide on how to get started with <code>metal3</code>.</p>
<p>If you plan to use an Amazon service like EKS and want to scale based on your on-premise k8s nodes, you will need a specialized EKS offering like <code>EKS Anywhere</code> which is very expensive.</p>
