DaemonSets are an integral part of the Kubernetes cluster facilitating administrators to easily configure services (pods) across all or a subset of nodes.
Where we can use DaemonSets?
As daemonSets helps to improve the performance of a Kubernetes cluster by distributing maintenance tasks and support services by deploying the pods across all the nodes. Even you can use this for the job which needs to be run on all the nodes, like metric monitoring, log collector, etc. Following is some examples use cases of DaemonSets:
- To run a daemon for logs collection on each node, such as Fluentd and logstash.
- To run a daemon for cluster storage like glusterd and ceph on each node.
- To run a daemon which does logs rotation and cleaning log files.
- To run a daemon that runs on each node, detects node problems and reports them to the api-server, like node-problem-detector.
- To run a daemon for node monitoring on every note, such as Prometheus Node Exporter, collectd.
- Even you can use for storing the cache across all the node, like if there is large file need to be accessible by the users, you can mount some cloud volume and expose it.
Depending on the requirement, you can set up one or multiple DaemonSets for a single type of daemon, with different flags, memory, CPU, etc. that supports multiple configurations and hardware types.