What Is a Kubernetes DaemonSet? Run and update a Pod on each node
A DaemonSet keeps one copy of a Pod on every eligible node, or on a selected set of nodes. It fits node-level work such as log collection, monitoring agents, and network plugins, where placement on each host matters more than a replica count. Use a Deployment for application replicas that can run on any node and scale independently.
A DaemonSet keeps one copy of a Pod on every eligible node, or on a selected set of nodes. It fits node-level work such as log collection, monitoring agents, and network plugins, where placement on each host matters more than a replica count. Use a Deployment for application replicas that can run on any node and scale independently.
How node coverage works
The DaemonSet controller evaluates which nodes match the workload's scheduling rules, then creates or removes a Pod as nodes enter or leave that eligible set. Without a node selector or affinity restriction, it targets all nodes. A target does not guarantee a Ready Pod: lack of CPU or memory, image errors, volume failures, or application crashes can prevent it.
The controller adds tolerations for several built-in node taints so node agents can run during node initialization or some pressure conditions. You may add tolerations for your own taints, but a toleration only permits scheduling; it does not guarantee placement. Resource fit and all other scheduling constraints still apply. Decide explicitly whether agents should run on control-plane or isolated nodes.
Example: a log agent on Linux nodes
This illustrative manifest selects Linux nodes and mounts /var/log read-only. Replace the image with an approved image tag or digest and adapt paths, configuration, and permissions. hostPath exposes host files to the container, so mount only necessary paths and keep access read-only where possible. This manifest was not applied to a cluster.
apiVersion: apps/v1
kind: DaemonSet
metadata:
name: node-log-agent
namespace: observability
spec:
selector:
matchLabels:
app: node-log-agent
updateStrategy:
type: RollingUpdate
rollingUpdate:
maxUnavailable: 1
template:
metadata:
labels:
app: node-log-agent
spec:
nodeSelector:
kubernetes.io/os: linux
containers:
- name: agent
image: registry.example.com/observability/agent:<approved-tag-or-digest>
resources:
requests:
cpu: 100m
memory: 128Mi
volumeMounts:
- name: host-varlog
mountPath: /host/var/log
readOnly: true
volumes:
- name: host-varlog
hostPath:
path: /var/log
type: DirectoryThe selector must match the Pod template labels and cannot be changed after creation. A DaemonSet has no replicas field: changing node eligibility changes the desired Pod set. Confirm the path exists on each node, the agent can read it, and the placement policy covers the intended hosts.
Updates and availability
RollingUpdate is the default strategy. When the template changes, the controller replaces Pods on eligible nodes in a controlled rollout. maxUnavailable limits how many DaemonSet Pods may be unavailable during the update; its default is 1. A higher value can speed up rollout but leaves more nodes without the agent at once. maxSurge can allow a replacement Pod to start before the old Pod is removed, which can temporarily use more node resources. OnDelete waits for you to delete old Pods before they are recreated from the new template.
Use an image digest where practical, and make readiness checks reflect actual usefulness. A bad log parser or network-agent configuration can affect many nodes quickly, so stage changes and keep a rollback path.
Apply and diagnose
These commands are examples and were not run against a cluster. Check the target nodes and available resources first:
kubectl get nodes --show-labels
kubectl apply -f <daemonset.yaml>
kubectl get daemonset node-log-agent -n observability
kubectl get pods -n observability -l app=node-log-agent -o wide
kubectl describe daemonset node-log-agent -n observability
kubectl rollout status daemonset/node-log-agent -n observability --timeout=10mDESIRED shows the number of Pods needed for the current node selection; READY shows how many are ready. If they differ, inspect the wide Pod list and DaemonSet events. Pending can indicate resource shortages, selector or toleration mismatches, or volume issues. ImagePullBackOff points to image name, tag, or registry credentials; CrashLoopBackOff calls for logs and configuration checks. Do not remove unrelated node Pods blindly to make room: deleting unmanaged workloads can cause an outage.
DaemonSet, Deployment, or static Pod?
| Need | Typical choice | Why |
|---|---|---|
| Scale application replicas and roll them out | Deployment | Placement on a particular host is not the goal |
| Run an agent on every eligible or selected node | DaemonSet | Pod coverage follows the node set |
| Bootstrap control-plane components before the API is ready | Static Pod | Kubelet reads a local manifest; it is not managed as a normal API object |
| Manage a host operating-system service | system service such as systemd | The process belongs to host-level operations |
DaemonSet makes node agents manageable through Kubernetes, but does not make host access harmless or guarantee that an agent is collecting correctly. Minimize hostPath, host networking, and privileged access; monitor the agent's own health and collected output.
Sources
[DaemonSet concepts](https://kubernetes.io/docs/concepts/workloads/controllers/daemonset/)
[Rolling updates for a DaemonSet](https://kubernetes.io/docs/tasks/manage-daemon/update-daemon-set/)
[Taints and tolerations](https://kubernetes.io/docs/concepts/scheduling-eviction/taint-and-toleration/)
[Static Pods](https://kubernetes.io/docs/concepts/workloads/pods/static-pods/)
[Deployments](https://kubernetes.io/docs/concepts/workloads/controllers/deployment/)
Scope: eligible-node selection, Pod reconciliation, tolerations, update strategy, diagnosis, and workload choice. Kubernetes documentation was reviewed on 2026-11-22. YAML and commands are illustrative and were not run. Product-specific agent setup and host security policy are outside this scope.