DEV Community

Cover image for Replicaset vs Daemonset
Dheerajparikh
Dheerajparikh

Posted on

Replicaset vs Daemonset

ReplicaSet: The Ice Cream Truck

Imagine you own an ice cream truck business. You want to ensure that there are always three ice cream trucks roaming around the city to serve customers. If one truck breaks down, you immediately send out another one to replace it. This way, you always have three trucks on the road, no matter what.

Purpose: Keep a specific number of ice cream trucks (pods) running.
Scaling: If it’s a hot day and more people want ice cream, you can add more trucks to meet the demand.
Deployment: Focused on serving ice cream (stateless application) to as many people as possible.

DaemonSet: The Street Sweeper

Now, think about the city’s street sweepers. The city wants to ensure that every street in every neighborhood is cleaned regularly. So, they assign one street sweeper to each neighborhood. No matter how many neighborhoods there are, each one gets its own street sweeper.

Purpose: Ensure every neighborhood (node) has a street sweeper (pod).
Scaling: If a new neighborhood is built, a new street sweeper is automatically assigned to it.
Deployment: Focused on cleaning (node-level operation) every neighborhood.
In summary:

ReplicaSet is like making sure you always have a certain number of ice cream trucks on the road.
DaemonSet is like making sure every neighborhood has its own street sweeper.

I hope these examples made you smile! 😄 Do you have any other Kubernetes concepts you’d like to explore?

Top comments (2)

Collapse
 
tarsoqueiroz profile image
Tarso Dutra Blitzkow de Queiroz

Congrats, great analogy!!!

Collapse
 
dheerajparikh profile image
Dheerajparikh

Thanks, Glad you loved it.