<p>I have a conceptional question, does ReplicaSets use Pod settings?
Before i applied my ReplicaSets i deleted my Pods, so there is no information about my old Pods ?
If I apply now the Replicaset does this reference to the Pod settings, so with all settings like readinessProbe/livenessProbe ... ?
My Questions came up because in my replicaset.yml is a container section where I specified my docker image, but why does it need that information, isn't it a redundant information, because this information is in my pods.yml ?</p>

<pre><code>apiVersion: extensions/v1beta1
kind: ReplicaSet
metadata:
  name: test1
spec:
  replicas: 2
  template:
    metadata:
      labels:
        app: web
    spec:
      containers:
      - name: test1
        image: test/test
</code></pre>

djkobi97
<blockquote>
  <p>Pods are the smallest deployable units of computing that can be
  created and managed in Kubernetes.</p>
  
  <p>A Pod (as in a pod of whales or pea pod) is a group of one or more
  containers (such as Docker containers), with shared storage/network,
  and a specification for how to run the containers.</p>
</blockquote>

<p>See, <a href="https://kubernetes.io/docs/concepts/workloads/pods/pod/" rel="nofollow noreferrer">https://kubernetes.io/docs/concepts/workloads/pods/pod/</a>.</p>

<p>So, you can specify how your Pod will be scheduled (one or more containers, ports, probes, volumes, etc.).
But in case of the node failure or anything bad that can harm to the Pod, then that Pod won't be rescheduled (you have to rescheduled manually). So, in that case, you need a controller. Kubernetes provides some controllers (each one for different purposes). They are -</p>

<ol>
<li><a href="https://kubernetes.io/docs/concepts/workloads/controllers/replicaset/" rel="nofollow noreferrer">ReplicaSet</a></li>
<li><a href="https://kubernetes.io/docs/concepts/workloads/controllers/replicationcontroller/" rel="nofollow noreferrer">ReplicationController</a></li>
<li><a href="https://kubernetes.io/docs/concepts/workloads/controllers/deployment/" rel="nofollow noreferrer">Deployment</a></li>
<li><a href="https://kubernetes.io/docs/concepts/workloads/controllers/statefulset/" rel="nofollow noreferrer">StatefulSet</a></li>
<li><a href="https://kubernetes.io/docs/concepts/workloads/controllers/daemonset/" rel="nofollow noreferrer">DaemonSet</a></li>
<li><a href="https://kubernetes.io/docs/concepts/workloads/controllers/jobs-run-to-completion/" rel="nofollow noreferrer">Job</a></li>
<li><a href="https://kubernetes.io/docs/concepts/workloads/controllers/cron-jobs/" rel="nofollow noreferrer">CronJob</a></li>
</ol>

<p>All of the above controllers and the Pod together are called as Workload. Because they all have a <code>podTemplate</code> section. And they all create some number of identical Pods ass specified by the <code>spec.replicas</code> field (if this field exists in the corresponding workload manifest). They all are upper-level concept than Pod.</p>

<blockquote>
  <p>Though the <code>Deployment</code> is more suitable than the <code>ReplicaSet</code>, this answer focuses on <code>ReplicaSet</code> over <code>Pod</code> cause the question is between the <code>Pod</code> and <code>ReplicaSet</code>.</p>
</blockquote>

<p>In addition, each one of the above controllers has it's own purpose. Like a ReplicaSet’s purpose is to maintain a stable set of replica Pods running at any given time. As such, it is often used to guarantee the availability of a specified number of identical Pods.</p>

<p>A ReplicaSet contains a <code>podTemplate</code> field including selectors to identify and acquire Pod(s). A pod template specifying the configuration of new Pods it should create to meet the number of replicas criteria. It creates and deletes Pod(s) as needed to reach the desired number. When a ReplicaSet needs to create new Pod(s), it uses its Pod template.</p>

<p>The Pod(s) maintained by a ReplicaSet has <a href="https://kubernetes.io/docs/concepts/workloads/controllers/garbage-collection/#owners-and-dependents" rel="nofollow noreferrer">metadata.ownerReferences</a> field, to tell which resource owns the current Pod(s).</p>

<p>A ReplicaSet identifies new Pods to acquire by using its selector. If there is a Pod that has no OwnerReference or the OwnerReference is not a controller and it matches a ReplicaSet’s selector, it will be immediately acquired by said ReplicaSet.</p>

<p>Ref: <a href="https://kubernetes.io/docs/concepts/workloads/controllers/replicaset/" rel="nofollow noreferrer">https://kubernetes.io/docs/concepts/workloads/controllers/replicaset/</a></p>

<p>**</p>

<h2>Now, its time to answer your questions</h2>

<p>Since ReplicaSet is one of the Pod controller (listed above), obviously, it needs a <code>podTemplate</code> (using this template, your Pods will be scheduled). All of the Pods the ReplicaSet creates will have the same Pod configuration (same containers, same ports, same readiness/livelinessProbe, volumes, etc.). And having this <code>podTemplate</code> is not redundant info, it's needed. So, if you have a Pod controller like ReplicaSet or other (as your need), you don't need the Pod itself anymore. Because the ReplicaSet (or the other controllers) will create Pod(s).</p>

<p>**</p>

<p>Guess, you got the answer.</p>
