DaemonSet vs Deployment
Compare one-pod-per-node scheduling with normal replica-based application deployment in Kubernetes.
Containers
DaemonSet
A DaemonSet ensures that a pod runs on every node or on a selected set of nodes. It is commonly used for cluster-wide agents such as log collectors and monitoring exporters.
Containers
Deployment
A Deployment manages a specified number of replicas for a stateless application workload. It is the standard Kubernetes resource for most application deployments.
Key Differences
A DaemonSet runs one pod per node or selected node set, while a Deployment runs a chosen number of replicas anywhere the scheduler places them.
DaemonSets are typically used for node-level agents, while Deployments are used for normal application workloads.
DaemonSets scale automatically with node count, while Deployments scale based on desired replica count.
Deployments are best for APIs, frontends, and workers, while DaemonSets are best for agents that need cluster-wide coverage.
DaemonSets are about presence on nodes, while Deployments are about application replica management.
The two resources solve different workload models even though both create pods.
When to Use
When to use DaemonSet
Use DaemonSet for node agents such as monitoring exporters, security agents, networking components, or log shippers that must run on every node.
When to use Deployment
Use Deployment for stateless applications where you want a defined number of replicas, rollout control, and normal service-based traffic distribution.
Tradeoffs
DaemonSets provide guaranteed node coverage, but are not appropriate for standard stateless application scaling.
Deployments provide flexible replica control, but do not guarantee one pod per node.
Choosing the wrong one usually reflects misunderstanding of the workload model rather than a minor configuration issue.
Common Mistakes
Using DaemonSet for normal web applications.
Using Deployment for agents that should exist on every node.
Thinking both are interchangeable just because both create pods.
Interview Tip
The clean answer is: DaemonSet is for node coverage, Deployment is for normal application replicas.