ReviseAlgo Logo

Kubernetes Workloads

ReplicaSets — Keeping Pods Running

Maintaining pod counts and identifying mismatches.

Interview: Understand the relationship between ReplicaSets and Pods. Interviewers love to ask: How does a ReplicaSet identify which Pods to manage? Explain label selectors and how ReplicaSets acquire orphaned Pods. Note that you should rarely manage ReplicaSets directly; Deployments manage them for you.

Last Updated: June 15, 2026 8 min read

Role of a ReplicaSet

Pods are fragile. If a worker node crashes, the Pods running on it are lost. A **ReplicaSet** guarantees cluster stability by ensuring that a specified number of Pod replicas are running at any given time.

Label Selectors & Ownership

A ReplicaSet does not check container configurations to monitor replicas. Instead, it identifies the Pods it owns using **Label Selectors**.

If a Pod has labels that match a ReplicaSet's selector, the ReplicaSet assumes ownership of it. If you create a standalone Pod that has matching labels, the ReplicaSet controller will immediately adopt it and count it towards its active replica quota. If the replica quota is already met, the ReplicaSet will immediately terminate the newly created Pod!

ReplicaSet Manifest Example

Here is how a ReplicaSet manifest declares its selectors and pod templates: