Kubernetes takes the single responsibility principle very seriously. All Kubernetes objects are designed to do one thing and one thing only. And they are designed to do this one thing very well. In this regard, we have to understand Kubernetes ReplicaSets and Deployments. The ReplicaSet, as we have learned, is responsible for achieving and reconciling the desired state of an application service. This means that the ReplicaSet manages a set of pods.
The Deployment augments a ReplicaSet by providing rolling update and rollback functionality on top of it. In Docker Swarm, the swarm service would incorporate the functionality of both the ReplicaSet and the Deployment. In this regard, SwarmKit is much more monolithic than Kubernetes. The following diagram shows the relationship of a Deployment to a ReplicaSet:
Kubernetes deployment
In the preceding diagram, the ReplicaSet is defining and governing a set of identical pods. The main characteristics of the ReplicaSet are that...