Why deployment need replicaset, but daemonset and statefulset don't need

why deployment need replicaset, but daemonset and statefulset don’t need

ReplicaSets describe sets of interchangeable pods (all pods in a replicaSet are equivalent).

The Deployment is able to manage multiple ReplicaSets to perform rolling updates: it creates a new replicaSet for the new set of replicas (say, based on image:v2) and then scales up the new replicaset while it scales down the “old” replicaset.

In the statefulSet, the objects of the set are not interchangeable, so they cannot be described by a replicaSet: pods in the statefulSet are created in a specific order and have their own identity. When updating an StatefulSet, the existing pods are destroyed, and then recreated (based on the “new” specification), but keeping their identity.

For the DaemonSet, only one pod is required on each node, so there’s no need to manage multiple copies of the pod (on each node), and then, no ReplicaSet is needed. Again, to update the DaemonSet’s pod to a new version, the old pod is terminated (on each node) and a new one is created.