Skip to content

Commit

Permalink
add more clarification regarding priorityClassName use with DaemonSet (
Browse files Browse the repository at this point in the history
…#40851)

* add more clarification regarding priorityClassName use with DaemonSet

* Update daemonset.md

---------

Co-authored-by: Qiming Teng <tengqm@outlook.com>
  • Loading branch information
tzneal and tengqm committed Nov 7, 2023
1 parent 791c6f1 commit 6af5701
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
11 changes: 9 additions & 2 deletions content/en/docs/concepts/workloads/controllers/daemonset.md
Expand Up @@ -108,8 +108,8 @@ If you do not specify either, then the DaemonSet controller will create Pods on

## How Daemon Pods are scheduled

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

{{< note >}}
If it's important that the DaemonSet pod run on each node, it's often desirable
to set the `.spec.template.spec.priorityClassName` of the DaemonSet to a
[PriorityClass](/docs/concepts/scheduling-eviction/pod-priority-preemption/#priorityclass)
with a higher priority to ensure that this eviction occurs.
{{< /note >}}

The user can specify a different scheduler for the Pods of the DaemonSet, by
setting the `.spec.template.spec.schedulerName` field of the DaemonSet.

Expand Down
3 changes: 3 additions & 0 deletions content/en/examples/controllers/daemonset.yaml
Expand Up @@ -35,6 +35,9 @@ spec:
volumeMounts:
- name: varlog
mountPath: /var/log
# it may be desirable to set a high priority class to ensure that a DaemonSet Pod
# preempts running Pods
# priorityClassName: important
terminationGracePeriodSeconds: 30
volumes:
- name: varlog
Expand Down

0 comments on commit 6af5701

Please sign in to comment.