Sobes.tech
Junior — Middle

What is the difference between using DaemonSet and simply a replica in Kubernetes?

sobes.tech AI

Answer from AI

In Kubernetes, DaemonSet and ReplicaSet (or simply replica) serve different purposes:

  • DaemonSet ensures that a copy of a pod is running on each (or selected) node of the cluster. This is useful for running system agents, monitoring, logging, network proxies, and other services that need to operate on all nodes.

  • ReplicaSet (or Deployment with replicas) manages the number of pod copies in the cluster but does not guarantee their distribution across nodes. Replicas can be placed on any nodes depending on available resources and scheduling rules.

Thus, if you need pods to be running on all nodes, use DaemonSet. If you just want to scale the application by the number of copies, use ReplicaSet or Deployment.