<p>I've got a node pool defined with min instances set to 1 and max instances set to 5, and autoscaling enabled.</p>

<p>However it does not seem to be scaling down.</p>

<ul>
<li>I have cordoned a node.</li>
<li>It has been over 12 hours</li>
<li>There are no pending pods</li>
<li>Removing a node would not reduce the amount of replicas of my own deployment</li>
</ul>

<p>The node in question has the following pods running on it:</p>

<ul>
<li>fluentd</li>
<li>kube-dns</li>
<li>kube-proxy-gke</li>
<li>metrics-server</li>
<li>redis</li>
</ul>

<p>All the pods above are in the <code>kube-system</code> namespace besides the <code>redis</code> pod which is defined within a daemonset.</p>

<p>Is there any additional configuration required? A pod disruption budget perhaps?</p>

<p>Output of <code>kubectl describe -n kube-system configmap cluster-autoscaler-status</code>:</p>

<pre><code>Name:         cluster-autoscaler-status
Namespace:    kube-system
Labels:       &lt;none&gt;
Annotations:  cluster-autoscaler.kubernetes.io/last-updated=2018-06-15 10:40:16.289611397 +0000 UTC

Data
====
status:
----
Cluster-autoscaler status at 2018-06-15 10:40:16.289611397 +0000 UTC:
Cluster-wide:
  Health:      Healthy (ready=4 unready=0 notStarted=0 longNotStarted=0 registered=4 longUnregistered=0)
               LastProbeTime:      2018-06-15 10:40:14.942263061 +0000 UTC
               LastTransitionTime: 2018-06-15 09:17:56.845900388 +0000 UTC
  ScaleUp:     NoActivity (ready=4 registered=4)
               LastProbeTime:      2018-06-15 10:40:14.942263061 +0000 UTC
               LastTransitionTime: 2018-06-15 09:18:55.777577792 +0000 UTC
  ScaleDown:   NoCandidates (candidates=0)
               LastProbeTime:      2018-06-15 10:40:14.942263061 +0000 UTC
               LastTransitionTime: 2018-06-15 09:39:03.33504599 +0000 UTC

NodeGroups:
  Name:        https://content.googleapis.com/compute/v1/projects/gcpwp-ayurved-subs-staging/zones/europe-west1-b/instanceGroups/gke-wordpress-preempt-nodes-9c33afcb-grp
  Health:      Healthy (ready=3 unready=0 notStarted=0 longNotStarted=0 registered=3 longUnregistered=0 cloudProviderTarget=3 (minSize=2, maxSize=3))
               LastProbeTime:      2018-06-15 10:40:14.942263061 +0000 UTC
               LastTransitionTime: 2018-06-15 09:17:56.845900388 +0000 UTC
  ScaleUp:     NoActivity (ready=3 cloudProviderTarget=3)
               LastProbeTime:      2018-06-15 10:40:14.942263061 +0000 UTC
               LastTransitionTime: 2018-06-15 09:18:55.777577792 +0000 UTC
  ScaleDown:   NoCandidates (candidates=0)
               LastProbeTime:      2018-06-15 10:40:14.942263061 +0000 UTC
               LastTransitionTime: 2018-06-15 09:39:03.33504599 +0000 UTC


Events:  &lt;none&gt;
</code></pre>

Chris Stryczynski
<p>There are a few constraints that could prevent the node from scaling down.</p>

<p>You should verify the pods you listed one by one against the <a href="https://github.com/kubernetes/autoscaler/blob/cluster-autoscaler-1.2.2/cluster-autoscaler/FAQ.md#what-types-of-pods-can-prevent-ca-from-removing-a-node" rel="nofollow noreferrer">What types of pods can prevent CA from removing a node?</a> documentation.
This should help you discover if there is a pod that prevents it.</p>

<p>If it is indeed the <code>redis</code> pod then you could try using the safe to evict annotation:</p>

<pre><code>"cluster-autoscaler.kubernetes.io/safe-to-evict": "true"
</code></pre>

<p>If it is one of the system pods I would try the same thing on other nodes to see if scaling down works on them.
According to the <a href="https://cloud.google.com/kubernetes-engine/docs/concepts/cluster-autoscaler#minimum_and_maximum_node_pool_size" rel="nofollow noreferrer">GKE documentation</a>, you should be able to scale down your cluster to 1 node per cluster or completely for a specific node pool.</p>
