Skip to content

Commit a457674

Browse files
authored
Merge pull request kubernetes#4173 from x13n/docs
Document DaemonSet eviction opt in/out behavior
2 parents a7ddc7e + 45f5b12 commit a457674

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed

cluster-autoscaler/FAQ.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ this document:
3232
* [How can I scale a node group to 0?](#how-can-i-scale-a-node-group-to-0)
3333
* [How can I prevent Cluster Autoscaler from scaling down a particular node?](#how-can-i-prevent-cluster-autoscaler-from-scaling-down-a-particular-node)
3434
* [How can I configure overprovisioning with Cluster Autoscaler?](#how-can-i-configure-overprovisioning-with-cluster-autoscaler)
35+
* [How can I enable/disable eviction for a specific DaemonSet](#how-can-i-enabledisable-eviction-for-a-specific-daemonset)
3536
* [Internals](#internals)
3637
* [Are all of the mentioned heuristics and timings final?](#are-all-of-the-mentioned-heuristics-and-timings-final)
3738
* [How does scale-up work?](#how-does-scale-up-work)
@@ -434,6 +435,30 @@ spec:
434435
serviceAccountName: cluster-proportional-autoscaler-service-account
435436
```
436437

438+
### How can I enable/disable eviction for a specific DaemonSet
439+
440+
Cluster Autoscaler will evict DaemonSets based on its configuration, which is
441+
common for the entire cluster. It is possible, however, to specify the desired
442+
behavior on a per pod basis. All DaemonSet pods will be evicted when they have
443+
the following annotation.
444+
445+
```
446+
"cluster-autoscaler.kubernetes.io/enable-ds-eviction": "true"
447+
```
448+
449+
It is also possible to disable DaemonSet pods eviction expicitly:
450+
451+
452+
```
453+
"cluster-autoscaler.kubernetes.io/enable-ds-eviction": "false"
454+
```
455+
456+
Note that this annotation needs to be specified on DaemonSet pods, not the
457+
DaemonSet object itself. In order to do that for all DaemonSet pods, it is
458+
sufficient to modify the pod spec in the DaemonSet object.
459+
460+
This annotation has no effect on pods that are not a part of any DaemonSet.
461+
437462
****************
438463
439464
# Internals
@@ -512,6 +537,17 @@ What happens when a non-empty node is terminated? As mentioned above, all pods s
512537
elsewhere. Cluster Autoscaler does this by evicting them and tainting the node, so they aren't
513538
scheduled there again.
514539
540+
DaemonSet pods may also be evicted. This can be configured separately for empty
541+
(i.e. containing only DaemonSet pods) and non-empty nodes with
542+
`--daemonset-eviction-for-empty-nodes` and
543+
`--daemonset-eviction-for-occupied-nodes` flags, respectively. Note that the
544+
default behavior is different on each flag: by default DaemonSet pods eviction
545+
will happen only on occupied nodes. Individual DaemonSet pods can also
546+
explicitly choose to be evicted (or not). See [How can I enable/disable eviction
547+
for a specific
548+
DaemonSet](#how-can-i-enabledisable-eviction-for-a-specific-daemonset) for more
549+
details.
550+
515551
Example scenario:
516552
517553
Nodes A, B, C, X, Y.
@@ -690,6 +726,8 @@ The following startup parameters are supported for cluster autoscaler:
690726
| `skip-nodes-with-system-pods` | If true cluster autoscaler will never delete nodes with pods from kube-system (except for DaemonSet or mirror pods) | true
691727
| `skip-nodes-with-local-storage`| If true cluster autoscaler will never delete nodes with pods with local storage, e.g. EmptyDir or HostPath | true
692728
| `min-replica-count` | Minimum number or replicas that a replica set or replication controller should have to allow their pods deletion in scale down | 0
729+
| `daemonset-eviction-for-empty-nodes` | Whether DaemonSet pods will be gracefully terminated from empty nodes | false
730+
| `daemonset-eviction-for-occupied-nodes` | Whether DaemonSet pods will be gracefully terminated from non-empty nodes | true
693731
694732
# Troubleshooting:
695733

0 commit comments

Comments
 (0)