diff --git a/content/en/docs/concepts/workloads/controllers/daemonset.md b/content/en/docs/concepts/workloads/controllers/daemonset.md index c033702068ca5..bd7cca541b339 100644 --- a/content/en/docs/concepts/workloads/controllers/daemonset.md +++ b/content/en/docs/concepts/workloads/controllers/daemonset.md @@ -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 @@ -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. diff --git a/content/en/examples/controllers/daemonset.yaml b/content/en/examples/controllers/daemonset.yaml index aa540e9697902..1650ecce4ac31 100644 --- a/content/en/examples/controllers/daemonset.yaml +++ b/content/en/examples/controllers/daemonset.yaml @@ -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