How Pods, ReplicaSets and Deployments Work Together
See how Kubernetes Deployments, ReplicaSets and Pods work together through a Minikube lab on scaling, self-healing, updates and troubleshooting.

✍️ Translate this blog into Hindi, Tamil or Telugu
Introduction
In our previous Kubernetes articles, we learned about Pods, ReplicaSets and Deployments individually.
But how do these three Kubernetes objects work together?
Imagine you are running a food delivery application. Your application needs to stay available even when a Pod fails. It should also handle more users when traffic increases, and you should be able to update the application without stopping everything.
🛍️✨ From the author · ByteStore1:1 DevOps Project & Learning Discussionโน500View offer →This is where Pods, ReplicaSets and Deployments work together.
Let's connect these three objects and see how they work together in a hands-on Minikube lab.
We will learn how to:
Understand the relationship between Pods, ReplicaSets and Deployments.
Create a Deployment using YAML.
Inspect the ReplicaSet and Pods created by a Deployment.
Understand labels, selectors and ownership.
Scale an application from three to five replicas.
Delete a Pod and observe automatic replacement.
Perform a rolling update and rollback.
Troubleshoot common Kubernetes problems.
1. Why Do We Need Pods, ReplicaSets and Deployments Together?
Let's understand the problem first.
Suppose we have a food delivery application running inside a single Pod.
What happens if that Pod gets deleted?
Our application may become unavailable.
What happens when more users start accessing the application?
A single Pod may not be enough to handle the increased workload.
What happens when we want to update the application to a newer version?
We need a way to manage these changes safely.
Kubernetes solves these problems using three important objects.
| Kubernetes object | Main responsibility |
|---|---|
| Pod | Runs the application container. |
| ReplicaSet | Maintains the required number of identical Pods. |
| Deployment | Manages ReplicaSets and provides scaling, rolling updates and rollbacks. |
Think of them as a team:
Pod: Does the actual application work.
ReplicaSet: Makes sure the required number of Pods are running.
Deployment: Manages the ReplicaSet and controls application updates.
2. How Do Pods, ReplicaSets and Deployments Work Together?
The relationship looks like this:

Let's understand each relationship.
Deployment โ ReplicaSet
A Deployment creates and manages a ReplicaSet.
For example, when we create a Deployment with three replicas, the Deployment controller creates a ReplicaSet to maintain three Pods.
ReplicaSet โ Pods
The ReplicaSet creates Pods based on the Pod template defined in the Deployment.
It continuously checks whether the required number of Pods exists.
If a Pod is deleted, the ReplicaSet creates a replacement.
What happens during an application update?
When we change the container image in a Deployment, Kubernetes creates a new ReplicaSet for the updated Pod template.
The Deployment controller gradually replaces Pods managed by the old ReplicaSet with Pods managed by the new ReplicaSet.
This process is called a rolling update.
3. Understand Labels and Selectors
Before starting the practical lab, let's understand two important Kubernetes concepts: labels and selectors.
What is a label?
A label is a key-value pair attached to a Kubernetes object.
For example:
labels:
app: food-appHere:
appis the label key.food-appis the label value.
Labels help us identify and organize Kubernetes objects.
What is a selector?
A selector is used to find Kubernetes objects that match specific labels.
For example:
selector:
matchLabels:
app: food-appThis tells Kubernetes to select Pods with the label app: food-app.
Why are labels and selectors important?
A ReplicaSet uses a selector to identify the Pods it should maintain.
The selector must match the labels in the Pod template.
For example:
selector:
matchLabels:
app: food-app
template:
metadata:
labels:
app: food-appNotice that both use the same label.
In apps/v1, the Deployment's selector must match the labels in the Pod template. If they do not match, the API server rejects the manifest with a validation error similar to:
selector does not match template labelsKubernetes also adds a pod-template-hash label to each ReplicaSet and to the Pods it creates. This helps distinguish Pods that belong to different ReplicaSets during a Deployment update.

4. What Is OwnerReference?
Kubernetes also maintains ownership information between related objects.
This is called an OwnerReference.
For our application:
The Deployment is the owner of the ReplicaSet.
The ReplicaSet is the owner of the Pods.
We can inspect this relationship using:
kubectl get rs -l app=food-app \
-o jsonpath='{.items[0].metadata.ownerReferences[0].kind}{"\n"}'Expected output:
DeploymentThis tells us that the selected ReplicaSet is owned by a Deployment.
Now check the Pods:
kubectl get pods -l app=food-app \
-o custom-columns=NAME:.metadata.name,OWNER:.metadata.ownerReferences[0].kindNote: Some columns have been omitted from the sample outputs for readability. Actual kubectl get output may also include columns such as AGE.
Expected output:
NAME OWNER
food-app-5754744b8-c2nr9 ReplicaSet
food-app-5754744b8-h89c9 ReplicaSet
food-app-5754744b8-jb4sr ReplicaSetPod names follow the pattern food-app-<replicaset-hash>-<pod-suffix>, and the exact values will be different in your cluster.
This confirms that the Pods are owned by a ReplicaSet.
Remember:
Labels and selectors help Kubernetes find matching objects. OwnerReferences record which controller owns an object. They are related concepts, but they are not the same thing.

5. What Happens When We Create a Deployment?
Let's understand the workflow.
When we create a Deployment, Kubernetes performs several operations.
We submit the Deployment YAML to the Kubernetes API server.
The Deployment controller notices the new Deployment.
The Deployment controller creates a ReplicaSet.
The ReplicaSet controller creates the required Pods.
The scheduler assigns the Pods to suitable nodes.
The kubelet on each assigned node starts the containers.
Kubernetes continuously monitors the desired and actual state.
For example, if we specify:
replicas: 3Kubernetes tries to maintain three Pods.
If one Pod is deleted, the ReplicaSet notices the difference and creates another Pod.
Now let's see this in action.
6. Hands-On Lab: Pods, ReplicaSets and Deployments
In this lab, we will create a Deployment called food-app using an NGINX container.
Lab environment
| Item | Value |
|---|---|
| Tool | Minikube |
| Namespace | default |
| Deployment | food-app |
| Container | nginx |
| Initial image | nginx:1.27-alpine |
| Initial replicas | 3 |
Step 1: Check Minikube status
Before creating Kubernetes resources, check whether Minikube is running.
minikube statusCheck your current Kubernetes context:
kubectl config current-contextExpected context:
minikubeIf Minikube is stopped, start it:
minikube start
What are we checking?
We want to make sure our local Kubernetes cluster is available before creating resources.
Step 2: Create a Deployment YAML file
Create a file:
nano food-app-deployment.yamlAdd the following YAML:
apiVersion: apps/v1
kind: Deployment
metadata:
name: food-app
spec:
replicas: 3
selector:
matchLabels:
app: food-app
template:
metadata:
labels:
app: food-app
spec:
containers:
- name: nginx
image: nginx:1.27-alpine
ports:
- containerPort: 80Save the file.

Let's understand the important fields.
| Field | Purpose |
|---|---|
apiVersion: apps/v1 | Uses the Kubernetes apps API. |
kind: Deployment | Creates a Deployment object. |
metadata.name | Names the Deployment food-app. |
replicas: 3 | Requests three Pods. |
selector.matchLabels | Selects Pods with the matching label. |
template | Defines how the Pods should be created. |
containers | Defines the container inside each Pod. |
image | Uses the NGINX container image. |
containerPort: 80 | Documents the container's application port. |
Important: containerPort: 80 does not expose the application outside the Pod. We will learn how to expose applications using Kubernetes Services in the next article.
Step 3: Create the Deployment
Apply the YAML file:
kubectl apply -f food-app-deployment.yamlExpected output:
deployment.apps/food-app createdWhat does this command do?
kubectlis the Kubernetes command-line tool.applycreates or updates a Kubernetes resource.-fspecifies the YAML file to use.
We have now created the Deployment.

Step 4: Inspect the Deployment
Run:
kubectl get deployment food-appExpected output:
NAME READY UP-TO-DATE AVAILABLE
food-app 3/3 3 3Let's understand the columns:
READY: Number of ready Pods compared with the desired number.UP-TO-DATE: Number of Pods updated to the current Pod template.AVAILABLE: Number of Pods available to serve the application.
Now get more details:
kubectl describe deployment food-appLook for these fields:
Replicas: 3 desired | 3 updated | 3 total | 3 availableThis confirms that the Deployment has three available replicas.
Step 5: Inspect the ReplicaSet
Run:
kubectl get rs -l app=food-appExpected output:
NAME DESIRED CURRENT READY
food-app-5754744b8 3 3 3The ReplicaSet name includes a generated hash, so your output may have a different name.

Now inspect the ReplicaSet:
kubectl describe rs -l app=food-appLook for these details:
Controlled By: Deployment/food-app
Replicas: 3 current / 3 desiredThis confirms that the Deployment owns the ReplicaSet.
Step 6: Inspect the Pods
Run:
kubectl get pods -l app=food-appExpected output:
NAME READY STATUS RESTARTS
food-app-5754744b8-c2nr9 1/1 Running 0
food-app-5754744b8-k7xpl 1/1 Running 0
food-app-5754744b8-w9dqt 1/1 Running 0We can see three Pods.
All three are:
Ready:
1/1Status:
RunningRestarts:
0
This means the three NGINX containers are running successfully.


Step 7: Verify the ownership relationship
Let's verify the relationship between the Deployment, ReplicaSet and Pods.
Check the owner of the ReplicaSet:
kubectl get rs -l app=food-app \
-o jsonpath='{.items[0].metadata.ownerReferences[0].kind}{"\n"}'Expected output:
DeploymentCheck the owner of each Pod:
kubectl get pods -l app=food-app \
-o custom-columns=NAME:.metadata.name,OWNER:.metadata.ownerReferences[0].kindExpected output:
NAME OWNER
food-app-5754744b8-c2nr9 ReplicaSet
food-app-5754744b8-k7xpl ReplicaSet
food-app-5754744b8-w9dqt ReplicaSetWe have now verified the ownership chain:
Deployment
|
v
ReplicaSet
|
v
Pods


Step 8: Scale the Deployment from 3 to 5 replicas
Suppose more users start accessing our food delivery application.
We want to increase the number of Pods from three to five.
Run:
kubectl scale deployment food-app --replicas=5Expected output:
deployment.apps/food-app scaledNow check the Deployment:
kubectl get deployment food-appExpected result:
READY UP-TO-DATE AVAILABLE
5/5 5 5Check the Pods:
kubectl get pods -l app=food-appWe should now see five Pods.
- using CLI:

2. using YAML

What happened behind the scenes?
We requested five replicas.
The Deployment updated the desired replica count.
The ReplicaSet noticed that only three Pods existed.
The ReplicaSet created two additional Pods.
Kubernetes started the containers.
The Deployment reached five available replicas.
Important: We scale the Deployment, not its child ReplicaSet. The Deployment manages the ReplicaSet and maintains the desired state.
Step 9: Delete a Pod and observe self-healing
Now let's test what happens when one Pod is deleted.
First, list the Pods:
kubectl get pods -l app=food-appChoose one Pod name from your output.
For example:
kubectl delete pod food-app-5754744b8-c2nr9Replace the example name with an actual Pod name from your output.
Now check the Pods again:
kubectl get pods -l app=food-appYou should still see five Pods after Kubernetes creates a replacement.
To watch the process in real time:
kubectl get pods -l app=food-app -wYou may observe:
Old Pod Terminating
New Pod Pending
New Pod ContainerCreating
New Pod RunningPress Ctrl + C to stop watching.
What happened?
We manually deleted one Pod.
The ReplicaSet noticed that only four Pods remained.
It created a replacement Pod.
The new Pod started successfully.
The Deployment returned to five available replicas.
This is called self-healing.
Remember that Kubernetes does not restore the deleted Pod with its original name. It creates a new Pod.
Also, if a container crashes inside an existing Pod, the kubelet may restart that container according to the Pod's restart policy. That is different from the ReplicaSet replacing a deleted Pod.

Step 10: Perform a rolling update
Now let's update the NGINX image.
Our current image is:
nginx:1.27-alpineWe will update it to:
nginx:1.28-alpineRun:
kubectl set image deployment/food-app nginx=nginx:1.28-alpineExpected output:
deployment.apps/food-app image updatedCheck the rollout:
kubectl rollout status deployment/food-appExpected output:
deployment "food-app" successfully rolled outNow check the Deployment:
kubectl get deployment food-appCheck the Pods:
kubectl get pods -l app=food-appVerify the image:
kubectl get deployment food-app \
-o jsonpath='{.spec.template.spec.containers[0].image}{"\n"}'Expected output:
nginx:1.28-alpineWhat happened behind the scenes?
We changed the image in the Deployment's Pod template.
The Deployment created a new ReplicaSet.
The new ReplicaSet created Pods using NGINX 1.28.
Kubernetes gradually replaced the old Pods.
The rollout completed successfully.
This process is called a rolling update.

A Deployment manages this process so that the application can remain available while Pods are being replaced, subject to the configured rollout strategy and available capacity.

Step 11: Check rollout history
Kubernetes maintains rollout history for Deployments.
Run:
kubectl rollout history deployment/food-appYou should see revision entries similar to:
REVISION CHANGE-CAUSE
1 <none>
2 <none>The number of revisions depends on the changes made to the Deployment.

Step 12: Roll back to the previous version
Suppose the new application version has a problem.
We can return to the previous Deployment revision.
Run:
kubectl rollout undo deployment/food-appExpected output:
deployment.apps/food-app rolled backCheck the rollout:
kubectl rollout status deployment/food-appExpected output:
deployment "food-app" successfully rolled outVerify the image:
kubectl get deployment food-app \
-o jsonpath='{.spec.template.spec.containers[0].image}{"\n"}'Expected output:
nginx:1.27-alpineThe Deployment has returned to the previous image version.
What happened?
Kubernetes restored the previous Pod template and updated the Deployment. It created or reused the appropriate ReplicaSet and replaced Pods as needed.
The original deleted or replaced Pods do not come back. New Pods are created from the restored template.

7. Common Kubernetes Troubleshooting Scenarios
During practical work, you may encounter Pods that do not start or Deployments that do not reach the desired number of available replicas.
Let's reproduce some common problems and understand how to investigate them.
Scenario 1: Pod stuck in Pending
What does Pending mean?
Pending means the Pod has been accepted by the cluster, but its containers are not running yet. For example, it may be waiting for a suitable node or waiting for its container image to be pulled.
Let's reproduce an insufficient CPU scenario.
Create a file:
nano pending-pod.yamlAdd:
apiVersion: v1
kind: Pod
metadata:
name: pending-demo
spec:
containers:
- name: nginx
image: nginx:1.27-alpine
resources:
requests:
cpu: "100"Here, 100 requests 100 CPU cores, which is intentionally unrealistic for our Minikube node.
Apply the file:
kubectl apply -f pending-pod.yamlCheck the Pod:
kubectl get pod pending-demoThe Pod should remain in Pending state.
Now investigate:
kubectl describe pod pending-demoLook at the Events section.
Our Minikube lab produced:
Warning FailedScheduling
0/1 nodes are available: 1 Insufficient cpu.Why did this happen?
The scheduler could not find a node with enough available CPU to satisfy the requested resources.
How do we fix it?
Reduce the CPU request to a realistic value supported by the cluster, or provide a node with enough available CPU.
For this demonstration, we can simply delete the test Pod:
kubectl delete pod pending-demo
Scenario 2: ImagePullBackOff
What does ImagePullBackOff mean?
Kubernetes cannot download the requested container image and is waiting before retrying.
Let's intentionally use an invalid image tag.
Create:
nano image-error-pod.yamlAdd:
apiVersion: v1
kind: Pod
metadata:
name: image-error-demo
spec:
containers:
- name: nginx
image: nginx:this-image-does-not-existApply the file:
kubectl apply -f image-error-pod.yamlCheck the Pod:
kubectl get pod image-error-demoIt may initially show ContainerCreating or ErrImagePull before reaching ImagePullBackOff.
Investigate:
kubectl describe pod image-error-demoIn our lab, the Events showed messages similar to:
Failed to pull image "nginx:this-image-does-not-exist"
manifest for nginx:this-image-does-not-exist not found
Back-off pulling imageWhy did this happen?
We used an image tag that does not exist. Kubernetes could not download the image, so the container could not start.
How do we fix it?
Check the image name and tag. Replace the invalid image with a valid image and recreate or update the resource.
For this demonstration, clean up the test Pod:
kubectl delete pod image-error-demo
Scenario 3: CrashLoopBackOff
What does CrashLoopBackOff mean?
A container starts but repeatedly exits. Kubernetes tries to restart it, but the same failure happens again.
Let's reproduce this problem.
Create:
nano crash-pod.yamlAdd:
apiVersion: v1
kind: Pod
metadata:
name: crash-demo
spec:
containers:
- name: crash-container
image: busybox:1.36
command: ["sh", "-c", "echo Application starting; exit 1"]Apply the file:
kubectl apply -f crash-pod.yamlWatch the Pod:
kubectl get pod crash-demo -wYou may observe:
ContainerCreating
Error
CrashLoopBackOffPress Ctrl + C to stop watching.
Now check the logs:
kubectl logs crash-demoOur lab produced:
Application startingInvestigate further:
kubectl describe pod crash-demoLook for:
State: Waiting
Reason: CrashLoopBackOff
Last State: Terminated
Reason: Error
Exit Code: 1
Restart Count: 2Why did this happen?
Our command deliberately ends with:
exit 1An exit code of 1 indicates that the command failed.
Kubernetes restarted the container, but it failed again. After repeated failures, the container entered CrashLoopBackOff.
How do we fix it?
Check the container logs and configuration, identify why the application exits, and correct the application command or configuration.
For this demonstration, delete the test Pod:
kubectl delete pod crash-demo

Scenario 4: Deployment not reaching the desired replica count
Sometimes a Deployment requests five replicas, but not all Pods become available.
Let's reproduce this problem using our existing food-app Deployment.
First, verify the working image:
kubectl get deployment food-app \
-o jsonpath='{.spec.template.spec.containers[0].image}{"\n"}'Our working image is:
nginx:1.27-alpineNow intentionally set an invalid image:
kubectl set image deployment/food-app nginx=nginx:invalid-demo-tagCheck the rollout:
kubectl rollout status deployment/food-app --timeout=30sIn our lab, the command timed out because the new Pods could not become Ready.
Check the Deployment:
kubectl get deployment food-appOur actual output was:
NAME READY UP-TO-DATE AVAILABLE
food-app 4/5 3 4Check the Pods:
kubectl get pods -l app=food-appThree new Pods entered ImagePullBackOff, while four old Pods remained Running.
Now investigate:
kubectl describe deployment food-appWe could see that the new ReplicaSet used the invalid image:
Image: nginx:invalid-demo-tagWhy did this happen?
The Deployment accepted the image update, but the image could not be downloaded.
The rolling update strategy retained healthy old Pods while the new Pods failed to start.
This is an important example of why we should inspect both the Deployment and its Pods when troubleshooting.
How do we fix it?
Since the previous revision was healthy, the simplest fix is to roll back:
kubectl rollout undo deployment/food-app
kubectl rollout status deployment/food-appThen verify that the previous image has been restored:
kubectl get deployment food-app \
-o jsonpath='{.spec.template.spec.containers[0].image}{"\n"}'Expected image:
nginx:1.27-alpineAlternatively, we can explicitly set the image to the previous working version:
kubectl set image deployment/food-app nginx=nginx:1.27-alpineFor this scenario, Kubernetes' default rolling-update settings also help explain the observed output:
Desired replicas: 5.
maxSurge: 25%allows up to 2 additional Pods.maxUnavailable: 25%allows 1 unavailable Pod.Four old Pods remain available while three new Pods fail to start.
This matches our lab output: four available Pods, three updated Pods and seven Pods in total during the failed rollout.



8. Useful Troubleshooting Commands
Here are some useful commands to remember when working with Deployments, ReplicaSets and Pods.
| Command | Purpose |
|---|---|
kubectl get deployment | Lists Deployments. |
kubectl describe deployment food-app | Shows detailed Deployment information. |
kubectl get rs | Lists ReplicaSets. |
kubectl describe rs | Shows detailed ReplicaSet information. |
kubectl get pods | Lists Pods. |
kubectl describe pod POD_NAME | Shows detailed Pod information and Events. |
kubectl logs POD_NAME | Displays container logs. |
kubectl get events --sort-by=.lastTimestamp | Displays recent Kubernetes events. |
kubectl rollout status deployment/food-app | Checks rollout progress. |
kubectl rollout history deployment/food-app | Displays rollout history. |
kubectl rollout undo deployment/food-app | Rolls back the Deployment. |
Remember: kubectl describe is particularly useful when a Pod is not starting because its Events section often explains the problem.
9. YAML vs kubectl Commands
We can create and manage Kubernetes resources using YAML files or imperative commands.
Here are some examples from our lab.
| Task | YAML / Declarative approach | kubectl command |
|---|---|---|
| Create Deployment | kubectl apply -f food-app-deployment.yaml | kubectl create deployment food-app --image=nginx:1.27-alpine --replicas=3 |
| Scale Deployment | Update replicas: 5 in YAML and apply it | kubectl scale deployment food-app --replicas=5 |
| Update image | Update the image in YAML and apply it | kubectl set image deployment/food-app nginx=nginx:1.28-alpine |
| Check Deployment | Not applicable | kubectl get deployment food-app |
| Delete Pod | Not applicable | kubectl delete pod POD_NAME |
| Roll back | Not normally done by editing the original manifest | kubectl rollout undo deployment/food-app |
Both approaches are useful.
For repeatable application configurations, YAML files are especially helpful because we can store them in Git and review changes before applying them.
Important: If we change the replica count using kubectl scale, remember to update the YAML file too if we want it to reflect the new desired state. Otherwise, applying the old manifest later may change the replica count back.
10. Pods vs ReplicaSets vs Deployments
Let's compare the three objects one more time.
| Feature | Pod | ReplicaSet | Deployment |
|---|---|---|---|
| Runs containers | Yes | No, manages Pods | No, manages ReplicaSets |
| Maintains replica count | No | Yes | Through its ReplicaSets |
| Creates replacement Pods | No | Yes | Indirectly, through ReplicaSets |
| Scaling | Not directly | Yes | Yes |
| Rolling updates | No | No | Yes |
| Rollbacks | No | No | Yes |
A Pod runs the application.
A ReplicaSet maintains the required number of Pods.
A Deployment manages ReplicaSets and provides application update and rollback capabilities.
11. Common Mistakes to Avoid
Creating standalone Pods when a Deployment is needed for self-healing.
Using mismatched labels and selectors in a Deployment.
Scaling a ReplicaSet directly instead of scaling its Deployment.
Assuming
containerPortexposes an application outside the Pod.Changing replicas using
kubectl scalewithout updating the YAML manifest.Assuming a deleted Pod returns with the same name.
12. Things to know about Pods, ReplicaSets and Deployments
1. Can we create a Pod without a Deployment?
Yes. We can create a standalone Pod using a Pod YAML file.
However, a standalone Pod is not automatically recreated if it is deleted. For applications that need a desired number of replicas and self-healing, we generally use a Deployment.
2. Does a Deployment create Pods directly?
No. A Deployment creates and manages a ReplicaSet. The ReplicaSet creates and maintains the Pods.
3. What happens if we delete a Pod managed by a Deployment?
The ReplicaSet notices that the number of Pods is below the desired count and creates a replacement Pod.
4. What happens if we delete a ReplicaSet managed by a Deployment?
The Deployment controller notices that its desired ReplicaSet is missing and reconciles the Deployment by creating a replacement ReplicaSet.
5. Why does a Deployment create a new ReplicaSet during an update?
A new ReplicaSet represents the new Pod template, such as an updated container image.
The old ReplicaSet can be retained to support rollout history and rollback.
6. What is the difference between ImagePullBackOff and CrashLoopBackOff?
ImagePullBackOff means Kubernetes cannot download the container image.
CrashLoopBackOff means the container starts but repeatedly exits, so Kubernetes keeps trying to restart it.
7. Is containerPort enough to access an application from outside a Pod?
No. containerPort documents the container's port. To provide network access to an application, we generally use a Kubernetes Service.
13. What We Learned
Let's remember the main concepts:
A Pod runs one or more application containers.
A ReplicaSet maintains the desired number of Pods.
A Deployment manages ReplicaSets.
Labels and selectors help Kubernetes identify matching Pods.
OwnerReferences record ownership between Kubernetes objects.
Deleting a Pod managed by a ReplicaSet results in a replacement Pod.
Scaling changes the desired number of replicas.
Rolling updates help deploy a new application version gradually.
Rollbacks allow us to return to a previous Deployment revision.
kubectl describeandkubectl logsare useful troubleshooting commands.
The important relationship to remember is:

Kubernetes Learning Series
Kubernetes Pods Explained: Architecture, Lifecycle and Practical Examples
Kubernetes ReplicaSets Explained: Maintaining the Desired State
Kubernetes Deployments Explained: Rolling Updates and Rollbacksย
How Pods, ReplicaSets and Deployments Work Together - You are here.
Official Kubernetes Documentation
- kubernetes.io/docs/concepts/workloads/controllers/deployment/
- kubernetes.io/docs/concepts/workloads/controllers/replicaset/
- kubernetes.io/docs/concepts/workloads/pods/
- kubernetes.io/docs/concepts/overview/working-with-objects/labels/
- kubernetes.io/docs/tasks/debug/debug-application/debug-pods/
- kubernetes.io/docs/reference/kubectl/generated/kubectl_rollout/
❓ Questions readers ask
What is the relationship between Pods, ReplicaSets and Deployments?
A Deployment manages ReplicaSets, and ReplicaSets create and maintain Pods.
What happens when a Pod managed by a ReplicaSet is deleted?
The ReplicaSet detects the missing Pod and creates a replacement to maintain the desired replica count.
Can we scale a Deployment without changing its YAML file?
Yes. We can use kubectl scale deployment to change the replica count imperatively.
What is the difference between a ReplicaSet and a Deployment?
A ReplicaSet maintains the required number of Pods, while a Deployment manages ReplicaSets and supports rolling updates and rollbacks.
Why does Kubernetes create a new ReplicaSet during a rolling update?
A new ReplicaSet represents the updated Pod template, allowing Kubernetes to gradually replace the old Pods.
🛍️ Malathi Shetty's shelf
Courses, cohorts and more from the authorGet Malathi Shetty's next blog by email
One email a week when they publish. Add the weekly Best of ByteBlog too. No spam, unsubscribe with one click.
We email you once to confirm. By subscribing you agree to the privacy policy.
More from Malathi Shetty

Kubernetes Pods: Architecture, Lifecycle & Examples
Kubernetes is a powerful platform for managing containers, but understanding how it works can feel confusing when we encounter terms such as Pods, Nodes...
#deployments
Kubernetes Deployments Explained: Rolling Updates and Rollbacks
Learn how Kubernetes Deployments manage Pods, scale applications, perform rolling updates, roll back releases and troubleshoot common Pod issues.
#devops
Running Kubernetes Locally: kind vs minikube vs Docker Desktop
Learn how to set up Local Kubernetes with kind, minikube and Docker Desktop, deploy an NGINX application, and compare the tools through hands-on examples.
#cloud-native
Kubernetes ReplicaSets Explained: Maintaining the Desired State
Understand how Kubernetes ReplicaSets maintain the desired number of Pods, replace deleted Pods, and work with Deployments through practical examples.

💬 Comments (0)
Top · NewestSign in to comment