<p>This is my DaemonSet</p>
<pre class="lang-yaml prettyprint-override"><code>apiVersion: apps/v1
kind: DaemonSet
metadata:
  name: nginx
spec:
  selector:
    matchLabels:
      run: nginx
  template:
    metadata:
      labels:
        run: nginx
      annotations:
        &quot;cluster-autoscaler.kubernetes.io/enable-ds-eviction&quot;: &quot;false&quot;
        &quot;cluster-autoscaler.kubernetes.io/safe-to-evict&quot;: &quot;false&quot;
    spec:
      containers:
      - image: nginx
        imagePullPolicy: IfNotPresent
        name: nginx
        ports:
        - containerPort: 80
          protocol: TCP
</code></pre>
<p>According to the <a href="https://github.com/kubernetes/autoscaler/blob/master/cluster-autoscaler/FAQ.md#how-can-i-enabledisable-eviction-for-a-specific-daemonset" rel="nofollow noreferrer">documentation</a>.</p>
<p><strong>cluster-autoscaler.kubernetes.io/enable-ds-eviction: &quot;false&quot;</strong> should prevent scaling down.</p>
<p>But GKE cluster autoscaler ignores this annotation.</p>
<p>Is there any way to prevent DaemonSet from being evicted by the cluster autoscaler?</p>

<p>The <code>cluster-autoscaler.kubernetes.io/enable-ds-eviction</code> annotation does not apply once a node is actually empty.  During the scale down process, while the autoscaler is evicting/rescheduling pods elsewhere, it will ignore daemonsets when <code>cluster-autoscaler.kubernetes.io/enable-ds-eviction</code> is set to false.  Once the node is empty (i.e. no longer has any deployed pods), the node will then be removed (and the daemonset pod will be gracefully terminated).</p>
