πŸ“šBook Signing at KubeCon EU 2026Meet us at Booking.com HQ (Mon 18:30-21:00) & vCluster booth #521 (Tue 24 Mar, 12:30-1:30pm) β€” free book giveaway!RSVP Booking.com Event
Deployments intermediate ⏱ 15 minutes K8s 1.28+

DaemonSet Update Strategies Kubernetes

Configure DaemonSet rolling updates with maxUnavailable, OnDelete strategy, partition rollouts, and canary updates for node-level workloads like log collec.

By Luca Berton β€’ β€’ πŸ“– 5 min read

πŸ’‘ Quick Answer: Use updateStrategy.type: RollingUpdate with maxUnavailable: 1 for controlled DaemonSet rollouts. Use OnDelete for 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.17

maxUnavailable: 1 means only one node at a time loses its DaemonSet pod during updates.

OnDelete Strategy (Manual Control)

updateStrategy:
  type: OnDelete

Pods 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]
    end

Common 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: 1 for most DaemonSets β€” safe, controlled rollout
  • OnDelete for 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: 1 is 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
  • minReadySeconds prevents cascading failures from fast but unhealthy updates
#daemonset #rolling-update #ondelete #node-agent
Luca Berton
Written by Luca Berton

Principal Solutions Architect specializing in Kubernetes, AI/GPU infrastructure, and cloud-native platforms. Author of Kubernetes Recipes and creator of CopyPasteLearn courses.

Kubernetes Recipes book cover

Want More Kubernetes Recipes?

This recipe is from Kubernetes Recipes, our 750-page practical guide with hundreds of production-ready patterns.

Luca Berton Ansible Pilot Ansible by Example Open Empower K8s Recipes Terraform Pilot CopyPasteLearn ProteinLens