Modify replica counts on an existing installation

Kubernetes deployments

To modify replica counts for MSR resources using MSR Operator:

You can use the kubectl apply command on your custom resource manifest to modify replica counts across MSR resources.

For information on how many RethinkDB replicas to use, refer to the RethinkDB replica count table.

  1. In the cr-sample-manifest.yaml file, edit the key-value pair that corresponds to the MSR resource whose replica count you want to modify. For example, nginx:

    Note

    For the full configuration example, refer to the CRD file sample.

    nginx:
      replicaCount: <desired-replica-count>
    
  2. Invoke the following command to run the webhook health check and apply the changes to the custom resource:

    kubectl wait --for=condition=ready pod -l \
    app.kubernetes.io/name="msr-operator" && kubectl apply -f cr-sample-manifest.yaml
    
  3. Verify completion of the reconciliation process:

    kubectl get msrs.msr.mirantis.com
    kubectl get rethinkdbs.rethinkdb.com
    

    To troubleshoot the reconciliation process, run the following commands:

    kubectl describe msrs.msr.mirantis.com
    kubectl describe rethinkdbs.rethinkdb.com
    

    Review the MSR Operator Pod logs for more detailed results:

    kubectl logs <msr-operator-pod-name>
    
  4. Optional. Another way to troubleshoot the reconciliation process is to monitor the cluster scaling in the RethinkDB admin console.

To modify replica counts for MSR resources using a Helm chart:

You can use the helm upgrade command to modify replica counts across non-RethinkDB MSR resources. For the RethinkDB resources, refer to Modify replica counts for RethinkDB resources.

  1. In the ha.yaml file, edit the key-value pair that corresponds to the MSR resource whose replica count you wish to modify. For example, nginx:

    Note

    For the full configuration example, refer to The ha.yaml file sample.

    nginx:
      replicaCount: <desired-replica-count>
    
  2. To apply the new values, run helm upgrade:

    helm upgrade msrofficial/msr –-version 1.0.0 -f ha.yaml
    

Swarm deployments

  1. SSH into a manager node.

  2. Verify that you have the values.yaml that you generated to install and modify your MSR deployment.

  3. Scale your deployment to the required number of worker nodes:

    docker run \
      --rm \
      -it \
      -v /var/run/docker.sock:/var/run/docker.sock \
      -v <path-to-values.yml>:/config/values.yml \
      registry.mirantis.com/msr/msr-installer:<msr-version> \
      scale --replicas <number-of-replicas>
    

    Important

    Because RethinkDB uses a raft consensus algorithm to ensure data consistency and fault tolerance, you must install MSR onto an odd number of worker nodes.

  4. Review the status of the deployed services:

    docker stack services msr