I am aware about the hierarchical order of k8s resources. In brief,
- service: a service is what exposes the application to outer world (or with in cluster). (The service types like, CluserIp, NodePort, Ingress are not so much relevant to this question. )
- deployment: a deployment is what is responsible to keep a set of pods running.
- replicaset: a replica set is what a deployment in turn relies on to keep the set of pods running.
- pod: - a pod consist of a container or a group of container
- container - the actual required application is run inside the container.
The thing i want to empasise in this question is, why we have replicaset. Why don't the deployment directly handle or take responsibility of keeping the required number of pods running. But deployment in turn relies on replicset for this.
If k8s is designed this way there should be definitely some benefit of having replicaset. And this is what i want to explore/understand in depth.
