Kubernetes
DaemonSet
scheduling
configuration
container orchestration

Specify scheduling order of a Kubernetes DaemonSet

System Design practice on Codemia

Work through 120+ system design problems with detailed solutions, from rate limiters to multi-region storage.

Practice system design

Introduction

Kubernetes does not offer a strict "schedule these DaemonSet Pods in this exact node order" feature. A DaemonSet's job is to ensure that every eligible node gets a Pod. You can influence eligibility and rollout behavior, but not define a deterministic node-by-node scheduling sequence the way you might imagine from a batch scheduler.

Understand What a DaemonSet Controls

A DaemonSet creates one Pod per eligible node. Eligibility is shaped by things such as node selectors, affinity, taints, tolerations, and resource availability. Once a node is eligible, the DaemonSet controller and scheduler work to place the Pod there.

That means there are really two different questions developers often mix together:

  • Which nodes should run the DaemonSet
  • In what order should Pods appear or update

Kubernetes gives you good tools for the first question and partial control for the second, but not a strict global order.

Influence Placement with Labels and Affinity

If you need to stage DaemonSet rollout across groups of nodes, the normal pattern is to separate the nodes with labels and target them deliberately.

yaml
1apiVersion: apps/v1
2kind: DaemonSet
3metadata:
4  name: log-agent
5spec:
6  selector:
7    matchLabels:
8      app: log-agent
9  template:
10    metadata:
11      labels:
12        app: log-agent
13    spec:
14      affinity:
15        nodeAffinity:
16          requiredDuringSchedulingIgnoredDuringExecution:
17            nodeSelectorTerms:
18              - matchExpressions:
19                  - key: rollout-group
20                    operator: In
21                    values:
22                      - group-a
23      containers:
24        - name: agent
25          image: busybox
26          command: ["sh", "-c", "sleep 3600"]

With this approach, only nodes labeled rollout-group=group-a receive the Pod. Later, you can expand the label set or apply a second DaemonSet for the next group. This is how you approximate ordering: not by one global schedule, but by staged eligibility.

Use Update Strategy for Controlled Rollouts

For updates, the main built-in knob is the rolling update strategy. DaemonSets support maxUnavailable, which lets you limit how many nodes can be without the updated Pod at once.

yaml
1updateStrategy:
2  type: RollingUpdate
3  rollingUpdate:
4    maxUnavailable: 1

This does not let you say "node A before node B," but it does let you slow the rollout down and reduce disruption. If the order really matters because some nodes are more sensitive than others, split the rollout into multiple DaemonSets or use labels and manual progression.

PriorityClass can also affect which Pods get scheduled first under resource pressure, but that is still not the same as defining an exact DaemonSet order.

When You Need More Than One DaemonSet

If your operational requirement is "run this system Pod on one class of nodes first, verify it, then move to the rest," the clearest design is often multiple DaemonSets or one DaemonSet plus staged node labels. Trying to force a single DaemonSet into a strict node order usually works against the model Kubernetes actually provides.

This is common for logging agents, security agents, and storage helpers where a careful rollout matters more than immediate full coverage.

Common Pitfalls

The most common mistake is expecting a built-in field that defines a hard scheduling order for DaemonSet Pods. Kubernetes does not provide that.

Another issue is confusing rollout control with scheduling order. maxUnavailable helps manage disruption during updates, but it does not define a deterministic node sequence.

People also sometimes try to solve the problem with RBAC or unrelated controller settings when the real tools are node labels, affinity, taints, tolerations, and staged rollouts.

Summary

  • A DaemonSet does not support strict explicit node-by-node scheduling order.
  • You can influence which nodes are eligible by using labels, affinity, selectors, taints, and tolerations.
  • For updates, maxUnavailable controls rollout pressure but not exact node order.
  • If rollout order matters operationally, stage nodes into groups or use multiple DaemonSets.
  • Think in terms of eligibility and phased rollout rather than a hard scheduling sequence.

Related reading
Course
Beginner
27 lessons
10 hours
System Design Fundamentals

Build a strong foundation in designing scalable, reliable distributed systems.

View the course
Track what you have practised

A free account saves your progress, solutions and study plan across every problem on Codemia.

System Design practice on Codemia

Work through 120+ system design problems with detailed solutions, from rate limiters to multi-region storage.

Practice system design

All Rights Reserved.