ReplicaSet
What is ReplicaSet?
ReplicaSet: Keeps a fixed number of identical Pods running. Deployments create and manage ReplicaSets for you — you almost never touch one directly. A ReplicaSet in Kubernetes keeps a fixed number of identical pods running. If a pod dies, it creates a new one; if there are too many, it removes some.
Frequently asked questions about ReplicaSet
How is ReplicaSet used in practice?
You almost never create ReplicaSets yourself. A Deployment creates one for each version of your application and manages them during rollouts: the new ReplicaSet scales up while the old one scales down.
What should you keep in mind with ReplicaSet?
Old ReplicaSets are kept, scaled to zero, so kubectl rollout undo can switch back to a previous version quickly. revisionHistoryLimit on the Deployment controls how many are kept. When you see several ReplicaSets with names like web-7d9f8c in kubectl get rs, that is the Deployment's version history, not a problem to clean up.
What does an example of ReplicaSet look like?
kubectl get rs # web-7d9f8c 3 3 3 2m At a glance
| Category | Kubernetes |
|---|---|
| Explained by | Reinier de la Parra |
| Updated |