Skip to content

Commit 6af5701

Browse files
tznealtengqm
andauthored
add more clarification regarding priorityClassName use with DaemonSet (#40851)
* add more clarification regarding priorityClassName use with DaemonSet * Update daemonset.md --------- Co-authored-by: Qiming Teng <[email protected]>
1 parent 791c6f1 commit 6af5701

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

content/en/docs/concepts/workloads/controllers/daemonset.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,8 +108,8 @@ If you do not specify either, then the DaemonSet controller will create Pods on
108108

109109
## How Daemon Pods are scheduled
110110

111-
A DaemonSet ensures that all eligible nodes run a copy of a Pod. The DaemonSet
112-
controller creates a Pod for each eligible node and adds the
111+
A DaemonSet can be used to ensure that all eligible nodes run a copy of a Pod.
112+
The DaemonSet controller creates a Pod for each eligible node and adds the
113113
`spec.affinity.nodeAffinity` field of the Pod to match the target host. After
114114
the Pod is created, the default scheduler typically takes over and then binds
115115
the Pod to the target host by setting the `.spec.nodeName` field. If the new
@@ -118,6 +118,13 @@ the existing Pods based on the
118118
[priority](/docs/concepts/scheduling-eviction/pod-priority-preemption/#pod-priority)
119119
of the new Pod.
120120

121+
{{< note >}}
122+
If it's important that the DaemonSet pod run on each node, it's often desirable
123+
to set the `.spec.template.spec.priorityClassName` of the DaemonSet to a
124+
[PriorityClass](/docs/concepts/scheduling-eviction/pod-priority-preemption/#priorityclass)
125+
with a higher priority to ensure that this eviction occurs.
126+
{{< /note >}}
127+
121128
The user can specify a different scheduler for the Pods of the DaemonSet, by
122129
setting the `.spec.template.spec.schedulerName` field of the DaemonSet.
123130

content/en/examples/controllers/daemonset.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,9 @@ spec:
3535
volumeMounts:
3636
- name: varlog
3737
mountPath: /var/log
38+
# it may be desirable to set a high priority class to ensure that a DaemonSet Pod
39+
# preempts running Pods
40+
# priorityClassName: important
3841
terminationGracePeriodSeconds: 30
3942
volumes:
4043
- name: varlog

0 commit comments

Comments
 (0)