Member-only story
What is DaemonSet and Why Would You Use it?
A DaemonSet is a higher-level abstraction designed to ensure that a specific pod runs on all nodes in a cluster or on a subset of nodes based on specified criteria. DaemonSets guarantee a single instance of a pod runs on each eligible node. This ensures that every node in the cluster receives a copy of the pod, making DaemonSets particularly suitable for system-wide tasks.
For example, consider a logging agent that you wish to run on every node in your K8s cluster. By deploying this logging agent as a DaemonSet, you can ensure that as nodes are added or removed from the cluster, they automatically get or relinquish their own instance of the logging agent. This guarantees consistent log collection across the entire cluster, without manual intervention to deploy the agent on new nodes.
Explain the Difference Between Deployment and DaemonSet
A Deployment is primarily designed to describe stateless application replicas and ensure they are maintained, running, and evenly distributed across the nodes in the cluster. Deployments manage the state of ReplicaSets, which in turn manage pods. When scaling, updating, or rolling back, a Deployment creates a new ReplicaSet and increases the replicas while…