Welcome to this guide on DaemonSets in Kubernetes. In this tutorial, you’ll learn how DaemonSets work, their common use cases, and how to create one. DaemonSets enable you to run exactly one instance of a Pod on every node within your cluster. As your cluster scales—by adding or removing nodes—the DaemonSet automatically ensures that each node has the designated Pod running. This approach is particularly useful for deploying essential services like monitoring agents, log collectors, and networking components (for example, kube-proxy) consistently across all nodes.Documentation Index
Fetch the complete documentation index at: https://notes.kodekloud.com/llms.txt
Use this file to discover all available pages before exploring further.
While ReplicaSets ensure that a set number of Pod replicas are running across the cluster, DaemonSets guarantee that one copy of the Pod is present on every node.
Use Cases for DaemonSets
DaemonSets are primarily used in the following scenarios:- Monitoring and Logging: Deploy agents responsible for system monitoring and log collection across all nodes.
- Networking: Ensure a networking solution agent (e.g., VNet components or weave-net) is deployed on every node.
- Critical Infrastructure Components: Deploy essential components like kube-proxy that need to reside on every node.



Creating a DaemonSet
Creating a DaemonSet is quite similar to creating a ReplicaSet. The YAML definition file begins withapiVersion, kind, metadata, and spec sections. The primary difference is that the kind is set to DaemonSet, and it manages a Pod on every node rather than a specified number of replicas.
Below is an example DaemonSet definition file:
kind:
selector match those in the Pod template to guarantee proper functioning. Once your DaemonSet definition is ready, create it using the following kubectl command:
How DaemonSets Work
DaemonSets automatically schedule Pods on every node in your cluster. In earlier Kubernetes versions, thenodeName property was used to assign Pods directly to nodes, bypassing the scheduler. However, since version 1.12, DaemonSets leverage the default scheduler and node affinity rules to manage Pod placement.

- Monitoring
- Logging
- Networking