Skip to content

Commit

Permalink
add more clarification regarding priorityClassName use with DaemonSet
Browse files Browse the repository at this point in the history
  • Loading branch information
tzneal committed Apr 26, 2023
1 parent 8e6f2ee commit 00ed931
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
10 changes: 8 additions & 2 deletions content/en/docs/concepts/workloads/controllers/daemonset.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,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 @@ -115,6 +115,12 @@ 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 value
like `system-node-critical` 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
4 changes: 4 additions & 0 deletions content/en/examples/controllers/daemonset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ spec:
volumeMounts:
- name: varlog
mountPath: /var/log
# system-node-critical is the highest priority class and can be used to ensure that
# a critical daemonset's pod will evict an existing pod if that is required to allow
# the daemonset pod to schedule
priorityClassName: system-node-critical
terminationGracePeriodSeconds: 30
volumes:
- name: varlog
Expand Down

0 comments on commit 00ed931

Please sign in to comment.