Skip to content

Commit 0f00f23

Browse files
jeff-allen-mongojwilliams-mongo
authored andcommitted
(DOCSP-6879): Scaling up tutorial (#92)
* WIP * (DOCSP-6879): Scaling up tutorial * title modification * Updates per Cian's comments
1 parent 3d39f5d commit 0f00f23

File tree

5 files changed

+173
-1
lines changed

5 files changed

+173
-1
lines changed

conf.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,7 @@
116116
'.. |jedec| replace:: :abbr:`JEDEC (Joint Electron Device Engineering Council Solid State Technology Association)`',
117117
'.. |k8s-configmaps| replace:: `ConfigMaps <https://kubernetes.io/docs/tasks/configure-pod-container/configure-pod-configmap/>`__',
118118
'.. |k8s-configmap| replace:: `ConfigMap <https://kubernetes.io/docs/tasks/configure-pod-container/configure-pod-configmap/>`__',
119+
'.. |k8s-custom-resource| replace:: `Custom Resource <https://kubernetes.io/docs/concepts/extend-kubernetes/api-extension/custom-resources/>`__',
119120
'.. |k8s-crds| replace:: `CustomResourceDefinitions <https://kubernetes.io/docs/tasks/access-kubernetes-api/extend-api-custom-resource-definitions/>`__',
120121
'.. |k8s-crd| replace:: `CustomResourceDefinition <https://kubernetes.io/docs/tasks/access-kubernetes-api/extend-api-custom-resource-definitions/>`__',
121122
'.. |k8s-mdbrscs| replace:: MongoDB Kubernetes resources',
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
---
2+
apiVersion: mongodb.com/v1
3+
kind: MongoDB
4+
metadata:
5+
name: <myreplicaset>
6+
namespace: <metadata.namespace> # Should match metadata.namespace in
7+
# your configmap file.
8+
spec:
9+
members: 4
10+
version: 4.0.6
11+
project: <myconfigmap> # Should match metadata.name in your
12+
# configmap file.
13+
credentials: <mycredentials>
14+
type: ReplicaSet
15+
persistent: true
16+
...
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
---
2+
apiVersion: mongodb.com/v1
3+
kind: MongoDB
4+
metadata:
5+
name: <myshardedcluster>
6+
namespace: <metadata.namespace> # Should match metadata.namespace in
7+
# your configmap file.
8+
spec:
9+
shardCount: 3
10+
mongodsPerShardCount: 3
11+
mongosCount: 3
12+
configServerCount: 4
13+
version: 4.0.6
14+
project: <myconfigmap> # Should match metadata.name in your
15+
# configmap file.
16+
credentials: <mycredentials>
17+
type: ShardedCluster
18+
persistent: true
19+
...

source/tutorial/edit-deployment.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,9 @@ Procedure
5454
- You can set some settings using |k8s-op-short| only. To review the
5555
list of settings, see :doc:`/reference/k8s-op-exclusive-settings`.
5656

57-
5857
.. toctree::
5958
:titlesonly:
6059
:hidden:
6160

6261
/tutorial/upgrade-mdb-version
62+
/tutorial/scale-resources

source/tutorial/scale-resources.txt

Lines changed: 136 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,136 @@
1+
==================
2+
Scale a Deployment
3+
==================
4+
5+
.. default-domain:: mongodb
6+
7+
.. contents:: On this page
8+
:local:
9+
:backlinks: none
10+
:depth: 1
11+
:class: singlecol
12+
13+
You can scale your :term:`replica set` and :term:`sharded cluster`
14+
deployments up or down to match your desired configuration. Scaling up
15+
increases the number of members and/or shards in the deployment,
16+
thereby improving your deployment's redundancy and availability. The
17+
scale of your deployment is configured in its corresponding
18+
|k8s-custom-resource|.
19+
20+
Scale a Replica Set
21+
To scale your replica set deployment, set the :setting:`spec.members`
22+
setting to the desired number of replica set members. To learn more
23+
about replication, see :manual:`Replication </replication/>` in the
24+
MongoDB manual.
25+
26+
Scale a Sharded Cluster
27+
To scale your sharded cluster deployment, set the following settings
28+
as desired:
29+
30+
.. list-table::
31+
:header-rows: 1
32+
:widths: 20 40
33+
34+
* - Setting
35+
- Description
36+
37+
* - :setting:`spec.shardCount`
38+
- Number of :term:`shards <shard>` in the sharded cluster.
39+
40+
* - :setting:`spec.mongodsPerShardCount`
41+
- Number of members per shard.
42+
43+
* - :setting:`spec.mongosCount`
44+
- Number of Shard Routers.
45+
46+
* - :setting:`spec.configServerCount`
47+
- Number of members in the Config Server.
48+
49+
To learn more about sharded cluster configurations, see
50+
:manual:`Sharded Cluster Components
51+
</core/sharded-cluster-components/>` in the MongoDB manual.
52+
53+
Considerations
54+
--------------
55+
56+
The |k8s-op-short| does not support modifying deployment types.
57+
For example, you cannot convert a standalone deployment to a
58+
replica set. To modify the type of a deployment,
59+
we recommend the following procedure:
60+
61+
1. Create the new deployment with the desired configuration.
62+
63+
#. :opsmgr:`Back up the data </tutorial/nav/backup-deployments/>` from
64+
your current deployment.
65+
66+
#. :opsmgr:`Restore the data
67+
</tutorial/nav/backup-restore-deployments/>` from your current
68+
deployment to the new deployment.
69+
70+
#. Test your application connections to the new deployment as needed.
71+
72+
#. Once you have verified that the new deployment contains the
73+
required data and can be reached by your application(s), bring
74+
down the old deployment.
75+
76+
Examples
77+
--------
78+
79+
Select the desired tab based on the deployment configuration you
80+
want to scale:
81+
82+
.. tabs-deployments::
83+
84+
.. tab::
85+
:tabid: repl
86+
87+
Consider a replica set resource with the following
88+
|k8s-custom-resource|:
89+
90+
.. literalinclude:: /reference/k8s/example-replica-set-minimal.yaml
91+
:language: yaml
92+
:emphasize-lines: 9
93+
94+
To scale up this replica set and add more members:
95+
96+
1. Adjust the :setting:`spec.members` setting to the desired
97+
number of members:
98+
99+
.. literalinclude:: /reference/k8s/example-replica-set-minimal-scaled.yaml
100+
:language: yaml
101+
:emphasize-lines: 9
102+
103+
#. Reapply the configuration to |k8s|:
104+
105+
.. code-block:: none
106+
107+
kubectl apply -f <repl-set-config>.yaml
108+
109+
.. tab::
110+
:tabid: shard
111+
112+
Consider a sharded cluster resource with the following
113+
|k8s-custom-resource|:
114+
115+
.. literalinclude:: /reference/k8s/example-sharded-cluster-minimal.yaml
116+
:language: yaml
117+
:emphasize-lines: 9-12
118+
119+
To scale up this sharded cluster:
120+
121+
1. Adjust the following settings to the desired values:
122+
123+
- :setting:`spec.shardCount`
124+
- :setting:`spec.mongodsPerShardCount`
125+
- :setting:`spec.mongosCount`
126+
- :setting:`spec.configServerCount`
127+
128+
.. literalinclude:: /reference/k8s/example-sharded-cluster-minimal-scaled.yaml
129+
:language: yaml
130+
:emphasize-lines: 9-12
131+
132+
#. Reapply the configuration to |k8s|:
133+
134+
.. code-block:: none
135+
136+
kubectl apply -f <sharded-cluster-config>.yaml

0 commit comments

Comments
 (0)