<p>I am running a Kubernetes cluster(AWS EKS one) with <a href="https://github.com/kubernetes/autoscaler" rel="noreferrer">Autoscaler</a> pod So that Cluster will autoscale according to the resource request within the cluster.</p>
<p>Also, cluster will shrink no of nodes when the load is reduced. As I observed, Autosclaer can delete any node in this process.</p>
<p>I want to control this behavior such as asking Autoscaler to stop deleting nodes that runs a specific pod.
For example, If a node runs the Jenkins pod, Autoscaler should skip that node and delete other matching node from the cluster.</p>
<p>Will there a way to achieve this requirement. Please give your thoughts.</p>

<p>You can use <code>&quot;cluster-autoscaler.kubernetes.io/safe-to-evict&quot;: &quot;false&quot;</code></p>
<pre><code>...

template:
     metadata:
       labels:
         app: jenkins
       annotations:
         &quot;cluster-autoscaler.kubernetes.io/safe-to-evict&quot;: &quot;false&quot;

     spec:
       nodeSelector:
         failure-domain.beta.kubernetes.io/zone: us-west-2b
...
</code></pre>
