Replicaset replicas

Given a scenario, I have 2 pods with labels, name: myapp, and later I create a replicaset with selector, matchLabels: name: myapp, and replicas = 3 ,
Will the replicaset create all 3 new pods or just 1 more pod with labels, name: myapp ?

No, only One will be created.
Reason:
When the new ReplicaSet is created, it will look for pods with the label name: myapp If it doesn’t find enough pods (fewer than the specified replicas),it
will create new pods using the template defined in the ReplicaSet specification.

1 Like