A DaemonSet is a Kubernetes resource that ensures a copy of a pod runs on each node in your cluster. Think of it as a way to deploy a "background service" or utility that needs to be present and running on every machine in your infrastructure.
The name "DaemonSet" comes from the concept of a "daemon" in computing, which has a specific meaning:
A daemon is a computer program that runs as a background process, rather than being under the direct control of an interactive user. Daemons traditionally perform system-related tasks and services. They often start when the system boots and continue running until the system shuts down.
Classic examples of daemons in Unix/Linux systems include:
httpd
(the Apache web server daemon)
sshd
(the SSH daemon that handles secure shell connections)
syslogd
(the system logging daemon)
Notice how many of these daemon names end with "d" - this is a Unix naming convention to indicate a program is a daemon.
When you create a DaemonSet, the Kubernetes control plane automatically creates a pod on every node in your cluster matching the DaemonSet's node selector (or on all nodes if no selector is specified).
The DaemonSet controller constantly monitors your cluster for:
New nodes being added (it will deploy pods to them)
Nodes being removed (it will clean up those pods)
Pods being deleted (it will recreate them)
Changes to the DaemonSet specification (it will update all pods)
The key characteristic is that DaemonSets create exactly one pod per node - never more, never less (unless the node doesn't match the node selector criteria).
DaemonSets are perfect for infrastructure-level services that need to run everywhere, such as:
Monitoring agents - to collect metrics from every node
Log collectors - to gather logs from every node
Network plugins - to provide networking capabilities on all nodes
Storage plugins - to provide storage capabilities on all nodes
Security agents - to enforce security policies across all nodes