Horizontal scaling means that the response to increased load is to deploy more Pods. ObservedGeneration reflects the generation of the most recently observed ReplicaSet. A Deployment is a Kubernetes entity/object one level higher than a ReplicaSet, ie Deployments contain ReplicaSets, which in turn contain Pods. apiVersion: extensions/v1beta1 kind: ReplicaSet metadata: name: frontend # these labels can be applied automatically # from the labels in the pod template if not set # labels: # app: guestbook # tier: frontend spec: # this replicas value is default # modify it according to your case replicas: 3 # selector can be applied automatically # from the. yaml": no matches for apps/, Kind=ReplicaSet. name of the ReplicaSet is part of the basis for naming those Pods. The name of a ReplicaSet must be a valid DNS subdomain value, but this can produce unexpected In kubernetes 1. You can use the kubectl expose command to create a NodePort Service for a ReplicaSet. Selectors allow users to choose a specific subset of objects based on a shared set of labels. apiVersion: apps/v1 kind: ReplicaSet metadata: name. For clarification - I meant container. Creating a Kubernetes ReplicaSet. Sorted by: 1. metadata. Finally, the "spec" is the most important part of our YAML file. The name of a ReplicaSet must be a valid DNS subdomain value, but this can produce unexpected results for the Pod hostnames. For ReplicaSets, the kind is always a ReplicaSet. The selector is used to identifying the Pods it can acquire. 9 the API version apps/v1 on the ReplicaSet kind is the current version and is enabled by default. Building on replication controllers, OpenShift Container Platform adds expanded support for the software development and deployment lifecycle with the concept of DeploymentConfig objects. tier: Backend → We have defined the label tier as backend which creates a matching selector. replicas. kind: ReplicaSet → We have defined the kind as the replica set which helps kubectl to understand that the file is used to create a replica set. Now let’s inspect the ownerReferences of the ReplicaSet. yaml. 8. metadata. Load 7 more related questions Show fewer related questions Sorted by: Reset to default Know someone who can answer?. It can be used to reliably run a single Pod indefinitely or to run multiple instances of the same Pod. # kubectl delete rs soaktestrs replicaset "soaktestrs" deleted # kubectl get pods Again, the pods that were created are deleted when we delete the Replica Set. The Deployment creates a ReplicaSet that creates three replicated Pods, indicated by the . spec. Deploy and Configure Ops Manager Resources. It seems to support some of the same features of a ReplicationController - scale up/down and auto restart, but it's not clear if it supports rolling upgrades or autoscale. First, check the existing replica set using the following command. apiVersion: apps/v1 kind: ReplicaSet # this defines to create the object of replication type metadata: name: nginx spec: replicas: 3 # the element defines the desired number of pods selector:. See morekind: ReplicaSet. This helps to ensure that the desired state of the system is maintained. replicasetは特定のラベルのついたpodを監視している。 さっき見たみたいにレプリカ数が不足している場合は新たにpodが作成される。 それに対し、レプリカ数が過剰に存在している場合は該当するpodの内のpodをレプリカ数と同じ数になるように削除する。55 Thomson Place 2nd Floor Boston, MA 02210 Tel: +1 617 837 6840apiVersion: apps/v1 kind: ReplicaSet metadata: name: myapp2-rs spec: replicas: 3 # 3 Pods should exist at all times. The operator creates a config (and updates it) for the agent’s sidecar container responsible for configuring MongoDB in each Pod. If you use Deployments to manage your Kubernetes workloads, and most people do, then they will leave behind one ReplicaSet for each change you make. revisionHistoryLimit is an optional field that specifies the number of old ReplicaSets to retain to allow rollback. In the ownerReferences, the name of the owner is set to hello, and the kind is set to ReplicaSet. To manually delete a ReplicaSet, run the following command: kubectl delete rs <ReplicaSet_NAME> --cascade=false Next steps. NOTE: When you scale down a MongoDBCommunity resource, the Community Operator might take several minutes to remove the StatefulSet replicas for the members that you remove from the replica set. The Replicaset monitors the Pods that have the same label as the one specified in this selector field. This included ReplicationController, ReplicaSet, StatefulSet, DaemonSet, and Deployment. yaml. To add node selectors to an existing pod, add a node selector to the controlling object for that pod, such as a ReplicaSet object, DaemonSet object, StatefulSet object, Deployment object, or DeploymentConfig object. When the control plane creates new Pods for a ReplicaSet, the . Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. metadata: 레플리카셋의 정보를 입력하는 항목입니다. 9 versi API apps/v1 pada kind ReplicaSet adalah versi saat ini dan diaktifkan secara default. 9f3dc71 4 minutes ago. The. yaml apiVersion: apps/v1 kind: ReplicaSet # ประเภทของ Resource metadata: name: first-rs # ชื่อของ ReplicaSet labels: app: first-rs # Label ของ. A limit range defined in your project, where the defaults from the LimitRange object apply to Pods created during the deployment process. The continue option should be set when retrieving more results from the server. containers field. Get all pods with the labels plus the pod template hash. name of the ReplicaSet is part of the basis for naming those Pods. 8. Then create a Deployment object by running the following command: 1. In this example: A Deployment named nginx-deployment is created, indicated by the . 대소문자 표기에 주의합니다. When trying to set up a pod to pull the image i see CrashLoopBackoff. spec section is similar to the ReplicaSet’s, defining the pod template for each replica. allowWatchBookmarks requests watch events with type "BOOKMARK". Let’s use a ReplicaSet to scale up to five instances of our kuard container. In the simplest case, a. Selectors allow users to choose a specific subset of objects based on a shared set of labels. For ReplicaSets, the kind is always just ReplicaSet. Then, it internally creates Pods inside that ReplicaSet. spec is where you define the desired state and specifications for the ReplicaSet. 2. error: unable to recognize "kubia-replicaset. じゃあ、ReplicaSetで十分だから「Deployments」は使うことないのかというと、これは新しいバージョンのアプリをデプロイする時に役に立つ。. metadata. Kubernetes docs talk more about it. Keeping the Pods running with ReplicaSets. metadata. # kubectl delete rs soaktestrs replicaset "soaktestrs" deleted # kubectl get pods Again, the pods that were created are. When you create a ReplicaSet, you are essentially telling Kubernetes that you want a specific pod replicated x amount of times. Why Deployment manages multiple ReplicaSets? The answer is Kubernetes wants to support rollback mechanism. Create a ReplicaSet using image with latest tag only and remember to mention tag and name it as ; Labels app should be labels type should be front-end. Building on replication controllers, OpenShift Container Platform adds expanded support for the software development and deployment lifecycle with the concept of deployments. Here, it's a ReplicaSet. Image transformer configurations can be customized by creating a list of images containing the path and kind fields. spec. Table 8. name field. apiVersion: apps/v1. StatefulSets. 1 Answer. Query parameters; Parameter Type Description; allowWatchBookmarks. When the control plane creates new Pods for a ReplicaSet, the . Asking for help, clarification, or responding to other answers. 1. The config is saved to the Kubernetes Secret. yaml file are mounted in the Prometheus container in the /etc/config folder. This will cause the deployment controller to create a ReplicaSet, with one replica (which means it will only start one pod). my-image:latest. yaml’, and we will be submitting this. Replica sets provide redundancy and high availability and are the basis for all production deployments. As a kind of Pod manager running in your cluster, a ReplicaSet makes sure the desired number and type of a certain Pod is always up and running. A ReplicationController is a Kubernetes resource that ensures its pods are always kept running. selector: This specifies a label selector to identify the pods managed by this ReplicaSet. ReplicaSet is the next-generation ReplicationController that supports the new set-based label selector. Difference between Kubernetes Replication Controllers and Replica Sets. Horizontal Pod Autoscaling. Developed by MongoDB, MongoDBMulti Custom Resource Definition (CRD) makes it easy to run MongoDB replica sets across multiple Kubernetes environments and provides a declarative approach to deploying MongoDB, allowing users to specify the desired state of their deployment and letting the operator handle the details. metadata. Note. When you instantiate a ReplicaSet, it creates the desired number of replicas using the pod template. Kubernetes is only told what it can work with by the apiVersion and kind parameters, which should never be different. If the Labels of a ReplicaSet are empty, they are defaulted to be the same as the Pod(s) that the ReplicaSet manages. If you don't already have Octopus. The name of a ReplicaSet must be a valid DNS subdomain value, but this can produce unexpected results for the Pod hostnames. You can use the kind: deployment can check kubectl get rc still replica set will be there. It default to 1 if it was not. I found this trick though till I could find a better way. Refer to the first lines of the frontend. The differences in this manifest are: Using kind: Deployment to state the resource type. Any existing pods under that controlling object are recreated on a node with a matching label. When you deploy multiple replica sets using this method, you must make sure they each have a unique value for scramCredentialsSecretName. This name will become the basis for the ReplicaSets and Pods which are created later. To keep Pod running continuously you must specify a task that will never finish. Replicaset is one of the Kubernetes controllers. You need to complete all steps, certificate issuance cannot be. Use the same way to create deployment and modify kind to ReplicaSet in the yaml file and remove fields specific to deployment. You can put in there the configuration you want (for example take inspiration by the blog post you linked) and it will be used by Prometheus to handle the alerts. apps | grep "0 0 0" | cut -d' ' -f 1) This only works because of the way kubectl get all displays resources. Al igual que con el esto de los objeto de la API de Kubernetes, un ReplicaSet necesita los campos apiVersion, kind, y metadata. Kubernetes对象之Pod. As you said, you created 3 web based micro-service. When we deploy this replicaset it will create 3 Pods from this template. Does Kubernetes GET API actually support fieldSelector parameter to query values of array fields?. In Kubernetes, you do not create ReplicaSets directly. The ReplicaSet configuration defines a number of identical pods required, and if a pod is evicted or fails, it creates more pods to compensate for the loss. Let’s use a ReplicaSet to scale up to five instances of our kuard container. 3. 它的主要作用是 确保Pod以你指定的副本数运行 ,即如果有容器异常退出,会自动创建新的 Pod 来替代;而异常多出来的容器也会. The Pod(s) maintained by a ReplicaSet has metadata. 你可以通过设置 . spec 部分分为 副本数、选择器(选择算符)、Pod模板三个部分。 Replicas. spec: replicas: 3. 4. replicas field in the manifest. apiVersion: apps/v1 kind: ReplicaSet metadata. For example, by deploying OPA as an admission controller you can: Require specific labels on all resources. Add unique labels to the deployment's template. Driver and MongoDb. mongodb. Each new ReplicaSet updates the revision of the Deployment. ReplicaSet: It is an object that ensures a specified number of identical pod replicas are running at all times. The kind of this object is ReplicaSet; In the metadata part, we define the name by which we can refer to this ReplicaSet. ; You can check a Pod's status (which is a. list or watch objects of kind ReplicaSet. Clients should not assume bookmarks are. Deployments and Deployment Configurations. 11. ReplicaSet ensures that a specified number of pod replicas are running at any given time. Deploy Replica Sets on OpenShift . Deployments control the updating of its underlying entities. Replicaset rather than the replication controller is used by other objects like deployment. allowWatchBookmarks requests watch events with type "BOOKMARK". Procedure. Query parameters; Parameter Type Description; allowWatchBookmarks. copy. If even after these commands the pod is stuck on Unknown state, use the following command to remove the pod from the cluster:A ReplicaSet (RS) is a Kubernetes object that ensures there is always a stable set of running pods for a specific workload. Then, it’ll gradually move the Pods from the old ReplicaSet to the new one at a controlled rate. root@cyberithub:~# kubectl get pods -l tier=nginx NAME READY STATUS RESTARTS AGE replicaset-1-nhvlq 1/1 Running 0 16m replicaset-1-mrj7v 1/1 Running 0 16m. This will give you a detailed explanation of the resource passed as an argument as well as the fields you can populate. Pods can define tolerations, which allow them to be. The kind will be ReplicaSet, for obvious reasons; Metadata will contain the name and labels. Collection covers kubernetes exercises categorized topics-wise and referred back to the individual Kubernetes certification exams. It manages the lifecycle of pods and provides a way to scale and maintain the desired state of the application. By default, Kubernetes Operator uses the default namespace. boolean. metadata. Provide details and share your research! But avoid. A new ReplicaSet is created and the Deployment manages moving the Pods from the old ReplicaSet to the new one at a controlled rate. 2. Creating Pods and RCs works . As an example, you could be deploying a MySQL database with a primary instance and two read-only replicas. Thanks for your response. also, another suggestion don't use the Replicasets by default Deployment create the Replicaset in the background. The template of the replicaset looks as follows. 1 Answer. this may be used to filter the deployment based on this label. The name of a ReplicaSet must be a valid DNS subdomain value, but this can produce unexpected results for the Pod hostnames. Sorted by: 77. How Does The ReplicaSet Manifest Look? APIVersion, kind, and Metadata look like any other object in Kubernetes but the Spec section appear somewhat different from other objects. More broadly defined, Kubernetes troubleshooting also includes effective ongoing management of faults and taking measures to prevent issues in Kubernetes components. The main difference is that a ReplicaSet does not allow a rolling-update strategy. ReplicaSet. I can't really think of more information to share. yml). If any of the pods in the group die or get evicted, the ReplicaSet controller creates a replacement. Once our ReplicaSet template gets ready. The same behavior will be available even with deployment sets. template. This lab. spec. It will be composed by the number of. yaml. youbudong Update go. The number of replicas is 3. これらは、以下. list or watch objects of kind ReplicaSet. This is different from vertical. Means that GKE does not recognize ReplicaSet within apiVersion: apps/v1 I checked my cluster (I normally use deployments), pulled my replicaSet and it shows up as: apiVersion: extensions/v1beta1 kind: ReplicaSetThe kind of this object is ReplicaSet; In the metadata part, we define the name by which we can refer to this ReplicaSet. ) . 6" security: authentication: modes: ["SCRAM"] users: - name:. You can see the other types of objects that we create commonly on the right side here. However, a Deployment is a higher-level concept that manages. But rs can do complex matching. NOTE: kind, api_version, name, and namespace will be overwritten by corresponding values found in the configuration read in from the src file. For example, if you want to have four pods running at all times and one of them suddenly crashes, a ReplicaSet will ensure that the crashed one is removed and will spin up a new, hopefully healthy, one. To create a replica said execute the following command. In the replica sets, we used the selector. - apiVersion: apps/v1 kind: ReplicaSet name: router-default-66d5cf9464 uid: d81dd094-da26-11e9-a48a-128e7edf0312 controller: true blockOwnerDeletion: true. If any of the pods in the group die or get evicted, the ReplicaSet controller creates a replacement. Kubernetes troubleshooting is the process of identifying, diagnosing, and resolving issues in Kubernetes clusters, nodes, pods, or containers. Kind you can write code to find the Pod manager/controller depending on the type (ReplicaSet, DaemonSet, etc). Post navigation ← What Is A Container Scheduler? Kubernetes Deployments Compared To Docker Swarm Stacks →Creating Kubernetes pods, ReplicaSets, and deployments. Here’s an example: kubectl get pods -l app=nginx NAME READY STATUS RESTARTS AGE nginx-pod 1/1 Running 0 2m56s. Cleanup. Get the revision number of the deployment. allowWatchBookmarks requests watch events with type "BOOKMARK". And a new pod will spring to life to replace it: NAME READY STATUS RESTARTS AGE LABELS rs-quarkus-demo-2txwk 0/1 ContainerCreating 0 2s app=quarkus-demo,env=dev rs-quarkus-demo-jd6jk 1/1 Running 0 109s app=quarkus-demo,env=dev rs-quarkus-demo-t26gt 1/1. Provide details and share your research! But avoid. When the control plane creates new Pods for a ReplicaSet, the . Replica Set use Set-Based selectors which. selector: # Pods label should be defined in ReplicaSet label selector matchLabels: app: myapp2 template: metadata: name: myapp2-pod labels: app: myapp2 # Atleast 1 Pod label should match with ReplicaSet Label Selector spec. kubectl create -f my-replica-set. For example :While creating ReplicaSet, I am getting following error: The ReplicaSet "julrs" is invalid: spec. There's an example at the bottom of this blog post by. A ReplicaSet is a Kubernetes resource used to maintain a specified number of identical pod replicas within a cluster. Use the same way to create deployment and modify kind to ReplicaSet in the yaml file and remove fields specific to deployment. apps and replicaset. apiVersion: apps/v1 kind: ReplicaSet metadata: A new ReplicaSet is created and the Deployment manages moving the Pods from the old ReplicaSet to the new one at a controlled rate. Pod template: ReplicaSet uses a pod template to create and manage the replicated pods. A ReplicaSet is a Kubernetes object that ensures that a specified number of replicas of a pod are running at any given time. When the control plane creates new Pods for a ReplicaSet, the . template is the actual pod spec with which you. replication controllers are deprecated and is not recommended any more. The spec part is mandatory in the ReplicaSet object. Listing all the pods belonging to a deployment can be done by querying its selectors, but using the deployment’s synthesized replicaset identifier allows for easier automation. . apiVersion: v1 kind: Pod. Scaling of replicaset can also be done by using a resource called horizontal pod autoscaler. Deploy a MongoDBMultiCluster Resource. . apiVersion: apps/v1 kind: Deployment metadata: name: my-nginx labels: app: my-nginx # LABEL-A: <--this label is to manage the deployment itself. This is an essential mechanism for managing and scaling the Pods in a Kubernetes cluster. boolean. Zero-downtime deployments. As you can see, it uses the apps/v1 API version, the kind is ReplicaSet, and in this case the name is set to hello-world_v1. 9, the default garbage collection policy for many controller resources was orphan . A ReplicaSet identifies new Pods to acquire by using its selector. I also can't set the replica set to desire 0 pods, but that might be by design. ReplicaSetCondition describes the state of a replica set at a certain point. With the help of deployment You can simply roll back to a previous Deployment revision. spec: containers: - name: app-container. name of the ReplicaSet is part of the basis for naming those Pods. MongoDBCommunity metadata: name: example-mongodb spec: members: 3 type: ReplicaSet version: "4. 9, la version de l'API apps/v1 pour le type ReplicaSet est la version actuelle et activée par défaut. For ReplicaSets, the kind is always a ReplicaSet. For this the recommended approach is to use a Deployment, which under the hood create a ReplicaSet. apiVersion: v1 kind: Pod metadata: labels: run: redis name: redis spec: containers: - image: redis name: redis Save this as redis-pod. Try using one envFrom with multiple entries under it as below: - name: integration-app image: my-container-image envFrom: - secretRef: name: intercom-secret - secretRef: name: paypal-secret - secretRef: name: postgres-secret - secretRef: name: redis-secret. The following procedure describes how to configure to generate certificates for MongoDB Kubernetes Operator resources. docker pull microsoft<base image type>:<version> docker tag microsoft<base image type>:<version> microsoft<base image type>:latest docker build . The difference comes with the usage of selectors to replicate pods. Figure 13. 1 Answer. kubectl -n middleware-db get all NAME READY STATUS RESTARTS AGE pod/example-mongodb-0 2/2 Running 0 27m pod/example-mongodb-1 2/2 Running 0 26m pod/example-mongodb-2 2/2 Running 0 24m NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE service/example-mongodb-arb-svc ClusterIP None <none> 27017/TCP. image: my-image:latest. This is a template that may be useful: kubectl expose rs <REPLICASET_NAME> --port=<PORT> --target-port=<TARGET_PORT> --type=NodePort The most important flags are: NOTE: Detailed information on this command can be found. If you’re using any version of kubectl <= 1. Hashes for kubesplit-0. MySQL 5. 2. list or watch objects of kind ReplicaSet. Here, this replicaset will monitor Pods with the label tier: frontend. kubectl create -f my-replica-set. We no do deploy or manual changes. ReplicaSet. StatefulSet (stable-GA in k8s v1. Labels are the properties attached to each item/object. yaml. string. ReplicaSet :同じ仕様のPodを期待する数に維持するオブジェクト. This way I want to be able to make changes to the pod's system/image (haven't exactly figured out it's name) that at the moment it read-only file system. 1. yml. metadata. The replicaSet controller ensure that three pods are running at any point of time in the cluster. 1 ReplicaSets in a nutshellA ReplicaSet's purpose is to maintain a stable set of replica Pods running at any given time. To add node selectors to an existing pod, add a node selector to the controlling object for that node, such as a ReplicaSet, Daemonset, or StatefulSet. We will setup a single node Kubernetes cluster on our local machine using KinD (Kubernetes in Docker). v1 kind: Pod metadata: name. spec. このリソースは直接使用することは少ないが、次に出てくるDeploymentを抑える上で理解が進むのでやっていこう。. ReplicaSet 管理所有标签匹配与标签选择器的 Pod。. yml apiVersion: apps/v1 kind: ReplicaSet metadata: name: nginxwebserver spec: replicas: 3 # Desired. As with just about everything related to Kubernetes, we define our ReplicaSet via a YAML file. 2 then MongoDBCommunity v6. The name of a ReplicaSet must be a valid DNS subdomain value, but this can produce unexpected results for the Pod hostnames. As with all other Kubernetes API objects, a ReplicaSet needs the apiVersion, kind, and metadata fields. I'm creating a service of type LoadBalancer to access the MongoDB replica set from outs. spec. deployment "my-nginx" created. In kubernetes 1. 0. If you want to change which port has been intercepted, you can create a new intercept the same way you did above and it will change which service port is being intercepted. Spinnaker acknowledges this relationship with the blue load balancer icon on a workload as shown here: You can also tell Spinnaker which Service objects a workload should be associated with for its lifetime using the. kubectl get pods. In Kubernetes, Admission Controllers enforce policies on objects during create, update, and delete operations. selector. Additional fields in . The example below creates a ReplicaSet using a YAML file:. Having said that, the arbiter does take part in elections for the primary. yml manifest and use kubectl create or. apiVersion: apps/v1 kind: ReplicaSet metadata. In fact, you need to forget about the notion of pod. A regular ReplicaSet or Deployment would not be appropriate because you couldn't reliably identify the Pod running the primary replica. 16 replicaset was moved to apps/v1 apiVersion from extensions/v1beta1. spec: replicas: 3. For ReplicaSets, the kind is always a ReplicaSet. tier: Backend → We have defined the label tier. See Writing a Deployment Spec for more details. 16 replicaset was moved to apps/v1 apiVersion from extensions/v1beta1. 2. name of the ReplicaSet is part of the basis for naming those Pods. Let’s create a replicaset to understand this. When the control plane creates new Pods for a ReplicaSet, the . metadata. Deployments. metadata includes the name for the ReplicaSet, which is "my-replicaset". That's because two replica sets have two different . spec can be used such as minReadySeconds, paused and more. Rollback to an earlier Deployment revision if the current state of the Deployment is not stable. name field. To set deployment resources, choose one of the above options. Both are related to the limited control that deployments provide over how an application runs: Lack of granular control. name of the ReplicaSet is part of the basis for naming those Pods. name field. metadata. metadata: name: my-replicaset. so you must need to add template field . A ReplicaSet is defined with fields, including a selector that specifies how to identify Pods it can acquire, a number of replicas indicating how many Pods it should be maintaining, and a pod template specifying the data of new Pods it should create to meet the number of replicas criteria. Get all replica sets with the labels. The selector is used to identifying the Pods it can acquire. The preceding commands delete the ReplicaSet and all the pods that it manages. the ReplicaSet controller cant directly interact with Pods to perform exec or requests (only the kubelet can) possible workaround (might be too complex): the ReplicaSet controller chooses the Pods in the sample; the ReplicaSet controller "marks" these Pods to be probed; the kubelet probes the Pods and creates a Pod-event with the. Each rollback updates the revision of the Deployment. kind: ReplicaSet → We have defined the kind as the replica set which helps kubectl to understand that the file is used to create a replica set. A pod is the smallest unit of deployment in Kubernetes, and it usually…My minikube version: v1. Replication Controller and Replica Set do almost the same thing. name of the ReplicaSet is part of the basis for naming those Pods. A replica set is a group of MongoDB deployments that maintain the same data set. The operator creates a Pod with one init container and two app containers on it. ReplicaSet 管理所有标签匹配与标签选择器的 Pod。. Overview & Architecture Edit. In this blog, I will. docker. This post is the 4th in our Kubernetes training series, providing DevOps engineers with an introduction to Docker, Kubernetes, and Octopus. The spec part is mandatory in the ReplicaSet object. Saved searches Use saved searches to filter your results more quicklyThe field is named in plural, so I assume it should be possible to define more than one set of horizon definitions. net core web application that gets some information from MongoDB replica set but from time to time I'm getting a timeout errors. Table 8. (kind: ReplicaSet) ReplicaSet (rs) functions are almost identical to ReplicationController. They are followed by a metadata section with fields such as name, labels, etc. For Deployment, ReplicaSet, Replication Controller, only scale, if the number of existing replicas matches.