ReplicaSet

A ReplicaSet ensures a specified number of Pods are always running.

  • If a Pod dies → ReplicaSet spins up a new one.

  • If you scale the replica count → more Pods are created.

Uses labels to know which Pods it manages.

You usually don’t create ReplicaSets directly, they managed by ReplicaSet (which gives you extra feature).

Commands

To apply and run a Replicaset configuration:

kubectl apply -f replicaset.yaml

To list all the Replicasets, even the ones created by Deployments:

kubectl get replicasets

To describe a Replicaset:

kubectl describe replicaset <replicaset-name>

To delete a Replicaset:

Example

Last updated