@@ -17,23 +17,14 @@ recommendations for the |k8s-op-full| when running in production.
17
17
18
18
.. _deploy_recommended-number-sets:
19
19
20
- Deploy the Recommended Number of MongoDB Replica Sets
21
- -----------------------------------------------------
20
+ Deploy Multiple MongoDB Replica Sets
21
+ ------------------------------------
22
22
23
23
We recommend that you use a single instance of the |k8s-op-short|
24
- to deploy up to 20 replica sets in parallel .
24
+ to deploy and manage your MongoDB replica sets.
25
25
26
- You **may** increase this number to 50 and expect a reasonable
27
- increase in the time that the |k8s-op-short| takes to download,
28
- install, deploy, and reconcile its resources.
29
-
30
- For 50 replica sets, the time to deploy varies and might take up to
31
- 40 minutes. This time depends on the network bandwidth of the |k8s|
32
- cluster and the time it takes each {+mdbagent+} to download MongoDB
33
- installation binaries from the Internet for each MongoDB cluster member.
34
-
35
- To deploy more than 50 MongoDB replica sets in parallel,
36
- use multiple instances of the |k8s-op-short|.
26
+ To deploy more than 10 MongoDB replica sets in parallel,
27
+ you can :ref:`increase the thread count of your Kubernetes Operator instance <increase-thread-count-ops-manager>`.
37
28
38
29
Specify CPU and Memory Resource Requirements
39
30
--------------------------------------------
@@ -336,12 +327,20 @@ sharded clusters and standalone deployments.
336
327
.. _operator_pod_resources:
337
328
338
329
Set CPU and Memory Utilization Bounds for the |k8s-op-short| Pod
339
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
330
+ ----------------------------------------------------------------
331
+
332
+ When you deploy MongoDB replica sets with the |k8s-op-short|, the initial
333
+ reconcilliation process increases CPU usage for the Pod running the
334
+ |k8s-op-short|. However, when the replica set deployment process completes,
335
+ the CPU usage by the |k8s-op-short| reduces considerably.
336
+
337
+ .. note::
340
338
341
- When you deploy replica sets with the |k8s-op-short|, CPU usage for
342
- Pod used to host the |k8s-op-short| is initially high during the
343
- reconciliation process, however, by the time the deployment completes,
344
- it lowers.
339
+ The severity of CPU usage spikes in the |k8s-op-short| is directly impacted
340
+ by :ref:`the thread count <increase-thread-count-ops-manager>` of the
341
+ |k8s-op-short|, as the thread count (defined by the :ref:`MDB_MAX_CONCURRENT_RECONCILES <mdb-max-concurrent-reconciles>` value)
342
+ is equal to the number of reconcilliation processes that can be running in
343
+ parallel at any given time.
345
344
346
345
For production deployments, to satisfy deploying up to 50 MongoDB
347
346
replica sets or sharded clusters in parallel with the |k8s-op-short|,
@@ -353,22 +352,16 @@ as follows:
353
352
- ``spec.template.spec.containers.resources.requests.memory`` to 200Mi
354
353
- ``spec.template.spec.containers.resources.limits.memory`` to 1Gi
355
354
356
- If you don't include the unit of measurement for CPUs, |k8s| interprets
357
- it as the number of cores. If you specify ``m``, such as 500m, |k8s|
358
- interprets it as ``millis``. To learn more, see
359
- :k8sdocs:`Meaning of CPU </concepts/configuration/manage-resources-containers/#meaning-of-cpu>`.
355
+
356
+ If you use Helm to deploy resources, define these values in
357
+ the :ref:`values.yaml file <k8s-op-resources-setting>`.
360
358
361
359
The following abbreviated example shows the configuration with
362
360
recommended CPU and memory bounds for the |k8s-op-short| Pod in your
363
361
deployment of 50 replica sets or sharded clusters. If you are
364
362
deploying fewer than 50 MongoDB clusters, you may use lower
365
363
numbers in the configuration file for the |k8s-op-short| Pod.
366
364
367
- .. note::
368
-
369
- Monitoring tools report the size of the |k8s-node| rather than the
370
- actual size of the container.
371
-
372
365
.. example::
373
366
374
367
.. code-block:: yaml
@@ -431,7 +424,7 @@ file.
431
424
.. _mdb_pods_resources:
432
425
433
426
Set CPU and Memory Utilization Bounds for MongoDB Pods
434
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
427
+ -------------------------------------------------------
435
428
436
429
The values for Pods hosting replica sets or sharded clusters map
437
430
to the :k8sdocs:`requests field </reference/generated/kubernetes-api/{+k8s-api-version+}/#resourcerequirements-v1-core>`
@@ -450,10 +443,8 @@ for the MongoDB Pod as follows:
450
443
- ``spec.podSpec.podTemplate.spec.containers.resources.requests.memory`` to 512M
451
444
- ``spec.podSpec.podTemplate.spec.containers.resources.limits.memory`` to 512M
452
445
453
- If you don't include the unit of measurement for CPUs, |k8s| interprets
454
- it as the number of cores. If you specify ``m``, such as 500m, |k8s|
455
- interprets it as ``millis``. To learn more, see
456
- :k8sdocs:`Meaning of CPU </concepts/configuration/manage-resources-containers/#meaning-of-cpu>`.
446
+ If you use Helm to deploy resources, define these values in
447
+ the :ref:`values.yaml file <k8s-op-resources-setting>`.
457
448
458
449
The following abbreviated example shows the configuration with
459
450
recommended CPU and memory bounds for each Pod hosting a MongoDB
@@ -567,3 +558,53 @@ configurations for sharded clusters and standalone MongoDB deployments.
567
558
568
559
- :k8sdocs:`Running in Multiple Zones </setup/best-practices/multiple-zones/>`
569
560
- :k8sdocs:`Node affinity </concepts/scheduling-eviction/assign-pod-node/#node-affinity>`
561
+
562
+ .. _increase-thread-count-ops-manager:
563
+
564
+ Increase Thread Count to Run multiple Reconciliation Processes in Parallel
565
+ --------------------------------------------------------------------------
566
+
567
+ If you plan to deploy more than 10 MongoDB replica sets in parallel,
568
+ you can configure the |k8s-op-short| to run multiple reconciliation processes
569
+ in parallel by setting :ref:`MDB_MAX_CONCURRENT_RECONCILES <mdb-max-concurrent-reconciles>` environment variable in your |k8s-op-short|
570
+ deployment or or through the :ref:`operator.maxConcurrentReconciles <mdb-max-concurrent-reconciles-helm>` field in your Helm
571
+ ``values.yaml`` file to configure a higher thread count.
572
+
573
+ Increasing the thread count of the |k8s-op-short| allows you to vertically scale your |k8s-op-short|
574
+ deployment to hundreds of |k8s-mdbrscs| running within your |k8s| cluster
575
+ and optimize CPU utilization.
576
+
577
+ Please monitor |k8s| API server and |k8s-op-short| resource usage and adjust their respective
578
+ resource allocation if necessary.
579
+
580
+ .. note::
581
+
582
+ - Proceed with caution when increasing the :ref:`MDB_MAX_CONCURRENT_RECONCILES <mdb-max-concurrent-reconciles>` beyond 10.
583
+ In particular, you must monitor the |k8s-op-short|, and the |k8s| API
584
+ closely to avoid downtime resulting from increased load on those components.
585
+
586
+ To determine the thread count that suits your deployment's needs,
587
+ use the following guidelines:
588
+
589
+ - Your requirements for how responsive the |k8s-op-short| must be when
590
+ reconciling many resources
591
+
592
+ - The compute resources available within your |k8s| environment and
593
+ the total processing load your |k8s| compute resources are under, including
594
+ resources that may be unrelated to MongoDB
595
+
596
+ - An alternative to increasing the thread count of a single |k8s-op-short|
597
+ instance, while still increasing the number of |k8s-mdbrscs| you can support
598
+ in your |k8s| cluster, is to deploy multiple |k8s-op-short| instances within
599
+ your |k8s| cluster. However, deploying multiple |k8s-op-short|
600
+ instances requires that you ensure that no two |k8s-op-short| instances
601
+ are monitoring the same |k8s-mdbrscs|.
602
+
603
+ Running more than one instance of the |k8s-op-short| should be done with care,
604
+ as more |k8s-op-short| instances (especially with parallel reconciliation enabled)
605
+ put the API server at greater risk of being overwhelmed.
606
+
607
+ - Scaling of the |k8s| API server is not a valid reason to run
608
+ more than one instance of the |k8s-op-short|. If you observe that performance of
609
+ the API server is affected, adding more instances of the |k8s-op-short| is
610
+ likely to compound the problem.
0 commit comments