ReplicaSet Example Program

In the ReplicaSet, .spec.template.metadata.labels must match spec.selector, or it will be rejected by the API.

The .spec.selector field is a label selector. As discussed earlier these are the labels used to identify potential Pods to acquire. In our frontend.yaml example, the selector was:

Note: For 2 ReplicaSets specifying the same .spec.selector but different .spec.template.metadata.labels and .spec.template.spec fields, each ReplicaSet ignores the Pods created by the other ReplicaSet.
Replicas
Rajesh Kumar
Follow me