DaemonSet Update Strategies Kubernetes
Configure DaemonSet rolling updates with maxUnavailable, OnDelete strategy, partition rollouts, and canary updates for node-level workloads like log collec.
π‘ Quick Answer: Use
updateStrategy.type: RollingUpdatewithmaxUnavailable: 1for controlled DaemonSet rollouts. UseOnDeletefor manual control β pods only update when manually deleted. For canary updates, use node selectors to target specific nodes first.
The Problem
DaemonSets run on every node (log collectors, monitoring agents, CNI plugins). Updating them affects all nodes simultaneously by default. A bad update can break networking or observability cluster-wide. You need controlled rollout strategies.
The Solution
RollingUpdate Strategy
apiVersion: apps/v1
kind: DaemonSet
metadata:
name: fluentd
spec:
updateStrategy:
type: RollingUpdate
rollingUpdate:
maxUnavailable: 1
maxSurge: 0
template:
spec:
containers:
- name: fluentd
image: registry.example.com/fluentd:v1.17maxUnavailable: 1 means only one node at a time loses its DaemonSet pod during updates.
OnDelete Strategy (Manual Control)
updateStrategy:
type: OnDeletePods only update when manually deleted: kubectl delete pod fluentd-xxxxx. Use for CNI plugins where simultaneous updates could break networking.
Canary with Node Selectors
# Step 1: Label canary nodes
kubectl label nodes worker-1 worker-2 daemonset-canary=true
# Step 2: Deploy canary DaemonSet targeting labeled nodes
spec:
template:
spec:
nodeSelector:
daemonset-canary: "true"graph TD
subgraph RollingUpdate maxUnavailable=1
N1[Node 1: v2 β
] --> N2[Node 2: updating...] --> N3[Node 3: v1 waiting]
end
subgraph OnDelete
N4[Node 1: v1] --> DEL[Manual delete] --> N5[Node 1: v2]
endCommon Issues
DaemonSet rollout stuck
Check kubectl rollout status daemonset/fluentd. If pods canβt schedule (resource limits, node taints), the rollout blocks. Use kubectl describe pod on pending pods.
CNI plugin update breaks networking
Use OnDelete strategy for CNI DaemonSets. Rolling updates can cause brief network outages as the old CNI pod terminates before the new one is ready.
Best Practices
maxUnavailable: 1for most DaemonSets β safe, controlled rolloutOnDeletefor CNI plugins β manual control prevents network disruptions- Canary with node labels before full rollout β validate on 2-3 nodes first
- Monitor with
kubectl rollout statusβ watch progress in real-time minReadySeconds: 30β ensure pod is stable before moving to next node
Key Takeaways
- RollingUpdate with
maxUnavailable: 1is the safe default for DaemonSets - OnDelete gives manual control β pods only update when explicitly deleted
- Canary updates use node selectors to target specific nodes first
- CNI and networking DaemonSets should use OnDelete to prevent cluster-wide outages
minReadySecondsprevents cascading failures from fast but unhealthy updates

Recommended
Kubernetes Recipes β The Complete Book100+ production-ready patterns with detailed explanations, best practices, and copy-paste YAML. Everything in one place.
Get the Book βLearn by Doing
CopyPasteLearn β Hands-on Cloud & DevOps CoursesMaster Kubernetes, Ansible, Terraform, and MLOps with interactive, copy-paste-run lessons. Start free.
Browse Courses βπ Deepen Your Skills β Hands-on Courses
Courses by CopyPasteLearn.com β Learn IT by Doing
