Pods, ReplicaSets & Deployments These three components work together to run and manage applications in Kubernetes.
1. Pod
A Pod is the smallest unit in Kubernetes. It contains one or more containers that run your application.
Pod
└── Nginx Container
2. ReplicaSet
A ReplicaSet ensure that the desired number of identical Pods are running.
Example
If you want 3 Pods running:
ReplicaSet
|
---------
| | |
Pod Pod Pod
If one Pod crashes:
ReplicaSet
|
|--> Creates a new Pod
3. Deployment
A Deployment manages ReplicaSets and Pods.
It provides:
Scaling
Rolling Updates
Rollbacks
Self-Healing
Deployment
|
ReplicaSet
|
-----------
| | |
Pod Pod Pod
Relationship Between Them
How It Works
You create a Deployment.
Deployment creates a ReplicaSet.
ReplicaSet creates the required Pods.
If a Pod fails, ReplicaSet creates a new Pod.
Deployment manages updates and scaling.
Real-Life Example
Imagine a company:
Deployment = Manager
ReplicaSet = Supervisor
Pods = Workers
Manager decides how many workers are needed.
Supervisor ensures the required workers are present.
Workers perform the actual work.
Summary: A Pod runs the application, a ReplicaSet ensures the required number of Pods are running, and a Deployment manages ReplicaSets by providing scaling, rolling updates, rollbacks, and self-healing capabilities.
No comments:
Post a Comment
testing