Key Concepts
DaemonSet
A controller that ensures pods run on all matching nodes automatically.
Node Selector
Labels that restrict which nodes run the DaemonSet pods.
Tolerations
Allow DaemonSet pods to run on tainted nodes (e.g., master nodes).
Rolling Update
Gradual update of pods across nodes while maintaining availability.
Required Permissions
| Action | Permission |
|---|---|
| View daemonsets | iam:project:infrastructure:kubernetes:read |
| Restart daemonset | iam:project:infrastructure:kubernetes:write |
| Create daemonset | iam:project:infrastructure:kubernetes:write |
| Edit daemonset | iam:project:infrastructure:kubernetes:write |
| Delete daemonset | iam:project:infrastructure:kubernetes:delete |
DaemonSet Status Values
| Status | Description |
|---|---|
| Running | All desired nodes have ready pods |
| Updating | Rolling update in progress |
| NotReady | Some pods are not ready yet |
| Misscheduled | Pods running on nodes that shouldn’t have them |
| NoNodes | No nodes match the DaemonSet’s node selector |
| Unknown | Status cannot be determined |
DaemonSet Metrics
| Metric | Description |
|---|---|
| Desired | Number of nodes that should run the pod |
| Current | Number of nodes running at least one pod |
| Ready | Number of nodes with ready pods (ready/desired) |
| Available | Number of nodes with available pods |
| Misscheduled | Pods running where they shouldn’t |
| Updated | Nodes running the latest pod template |
How to View DaemonSets
How to View DaemonSet Details
How to Restart a DaemonSet
Restart triggers a rolling restart of pods on all nodes.Restart performs a rolling update by adding a
kubectl.kubernetes.io/restartedAt annotation. Pods are updated one node at a time by default.How to Create a DaemonSet
How to Edit a DaemonSet
Modify Spec
Edit the DaemonSet specification. Common changes:
- Container image (triggers rolling update)
- Resource requests/limits
- Environment variables
- Node selector or tolerations
Changes to the pod template spec trigger a rolling update. Pods are replaced on each node according to the update strategy.
How to Delete a DaemonSet
Update Strategies
DaemonSets support two update strategies:| Strategy | Description |
|---|---|
| RollingUpdate | Updates pods one node at a time (default). Configurable via maxUnavailable. |
| OnDelete | Only updates pods when they are manually deleted. |
maxUnavailable- Maximum pods that can be unavailable during update (default: 1)maxSurge- Maximum extra pods that can be created during update (optional)
Node Selection
DaemonSets use node selectors and tolerations to control pod placement: Node Selector:Troubleshooting
DaemonSet shows 0 desired pods
DaemonSet shows 0 desired pods
- No nodes match the node selector
- All matching nodes are tainted and DaemonSet lacks tolerations
- Check node labels match the DaemonSet’s node selector
- Verify tolerations for any taints on target nodes
Pods not running on some nodes
Pods not running on some nodes
- Node may have taints that pods don’t tolerate
- Node may not match the node selector
- Node may have insufficient resources
- Check node conditions and taints
Misscheduled pods (pods where they shouldn't be)
Misscheduled pods (pods where they shouldn't be)
- Node selector was changed after pods were scheduled
- Manually created pods matching the selector
- Delete misscheduled pods or update the selector
Rolling update taking too long
Rolling update taking too long
maxUnavailableset too low (default is 1)- Pods taking long to become ready
- Check pod events and logs for startup issues
- Consider increasing
maxUnavailablefor faster updates
Pods keep restarting on nodes
Pods keep restarting on nodes
- Check container logs for crash reasons
- Verify resource limits aren’t too restrictive
- Check if readiness/liveness probes are misconfigured
- Ensure required volumes (hostPath, ConfigMaps) exist on nodes
DaemonSet not running on new nodes
DaemonSet not running on new nodes
- New node may not match node selector
- New node may have taints
- Check if DaemonSet controller is healthy
- Verify the new node is in Ready state
FAQ
How is a DaemonSet different from a Deployment?
How is a DaemonSet different from a Deployment?
Deployments run a specified number of replicas scheduled across available nodes. DaemonSets run exactly one pod per matching node, automatically adding pods when nodes join and removing them when nodes leave.
Can I run DaemonSet pods on master/control-plane nodes?
Can I run DaemonSet pods on master/control-plane nodes?
Yes, by adding tolerations for control-plane taints. By default, master nodes have
node-role.kubernetes.io/control-plane:NoSchedule taint.How do I limit DaemonSet to specific nodes?
How do I limit DaemonSet to specific nodes?
Use
nodeSelector to match nodes with specific labels, or use nodeAffinity for more complex selection rules.What happens when I add a new node?
What happens when I add a new node?
The DaemonSet controller automatically schedules a pod on the new node if it matches the node selector and the pod tolerates any taints.
Can I scale a DaemonSet?
Can I scale a DaemonSet?
No. DaemonSets don’t have a replica count. The number of pods is determined by the number of matching nodes. To control pod placement, modify the node selector or node labels.
What's the difference between OnDelete and RollingUpdate?
What's the difference between OnDelete and RollingUpdate?
RollingUpdate automatically updates pods when the template changes. OnDelete only updates pods when they are manually deleted, giving you full control over update timing.
How do I update pods one node at a time?
How do I update pods one node at a time?
Use RollingUpdate strategy with
maxUnavailable: 1 (the default). This ensures only one pod is updated at a time across the cluster.Why doesn't my DaemonSet have pods on all nodes?
Why doesn't my DaemonSet have pods on all nodes?
Check node selector matches, taint tolerations, and resource availability. Some system DaemonSets intentionally exclude certain node types.