DaemonSet Update Strategies
What you'll learn: How to control how Kubernetes updates DaemonSet pods across all nodes in your cluster.
When you need to update a DaemonSet—perhaps to deploy a new version of your logging agent or monitoring tool—Kubernetes offers two strategies to manage how those updates roll out across your nodes.
The Two Update Strategies
RollingUpdate (default) gradually replaces old DaemonSet pods with new ones, node by node. Kubernetes automatically deletes the old pod on a node and creates the updated version, moving through your cluster systematically. This ensures continuous operation—your logging or monitoring never completely stops.
Think of it like updating streetlights in a city: you replace them one at a time or in small batches, so the city never goes completely dark.
OnDelete is a manual strategy. Kubernetes updates the DaemonSet specification but doesn't touch any running pods until you manually delete them. Only when you delete a pod does Kubernetes recreate it with the new configuration.
This is like scheduling maintenance: the new plan is ready, but workers only execute it when you give the green light for each location.
Configuring the Strategy
You set the update strategy in your DaemonSet manifest:
apiVersion: apps/v1
kind: DaemonSet
metadata:
name: node-monitor
spec:
updateStrategy:
type: RollingUpdate # or OnDelete
rollingUpdate:
maxUnavailable: 1 # Only with RollingUpdate
The maxUnavailable field controls how many DaemonSet pods can be unavailable during a rolling update, giving you control over update speed versus availability.
Key Takeaway: RollingUpdate automatically propagates DaemonSet changes across nodes gradually, while OnDelete gives you manual control over when each node's pod gets updated—choose based on your operational safety requirements.