Skip to content

Commit d409dd1

Browse files
JuliaMongojwilliams-mongo
authored andcommitted
(DOCSP-32707) Decide which Operators, for Single or Multi k8s Clusters (#1467)
* (DOCSP-32707) Decide which Operators, for Single or Multi k8s Clusters * (DOCSP-32707) Tech review and change of direction * Fix build warnings for the new conf.py substitution * Second round of reviews from Dan M, close to done I hope * Renamed one file, continued to turn the initial recommendation into a different recommendation in line with product direction * Edits * Edits * Edits * Edits * Added to multi-cluster namespace prereqs * Fix the build * build * Edits * a few more edits, to shorten and clarify * a few more edits, to shorten and clarify * edits again * Tech review * A few more review comments * Fix the build warning * Include copy review comments from Will * Include copy review comments from Will * Last copy review comments
1 parent a78e252 commit d409dd1

8 files changed

+157
-14
lines changed

conf.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,9 @@
153153
'.. |k8s-mdbrsc| replace:: ``MongoDB`` resource',
154154
'.. |mongodb-multi| replace:: ``MongoDBMultiCluster`` resource',
155155
'.. |mongodb-multis| replace:: ``MongoDBMultiCluster`` resources',
156+
'.. |mongodbusers| replace:: ``MongoDBUsers`` resources',
157+
'.. |opsmanager-resource| replace:: ``Ops Manager`` resource',
158+
'.. |opsmanager-resources| replace:: ``Ops Manager`` resources',
156159
'.. |k8s-nodes| replace:: `nodes <https://kubernetes.io/docs/concepts/architecture/nodes/>`__',
157160
'.. |k8s-node| replace:: `node <https://kubernetes.io/docs/concepts/architecture/nodes/>`__',
158161
'.. |k8s-nss| replace:: `namespaces <https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/>`__',

source/faq.txt

Lines changed: 48 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ configuration of MongoDB Server features, such as database backups,
3535
through interaction with |cloud| or |onprem|.
3636

3737
Why should I run MongoDB Server and MongoDB Enterprise Advanced in |k8s|?
38-
--------------------------------------------------------------------------
38+
------------------------------------------------------------------------------------
3939

4040
When you deploy MongoDB Server or MongoDB Enterprise Advanced in |k8s|
4141
through the |k8s-op-full|, your deployments can benefit from the
@@ -46,7 +46,7 @@ through the |k8s-op-full|. The |k8s-op-full| simplifies your daily workflows
4646
and makes it easier for MongoDB technical support staff to assist you when needed.
4747

4848
Which |k8s| platforms are supported for MongoDB Server deployments?
49-
-------------------------------------------------------------------------
49+
--------------------------------------------------------------------------------
5050

5151
MongoDB Server supports any platform that builds upon native |k8s| without
5252
changing the default logic or behavior. In practice, this means that
@@ -55,21 +55,63 @@ MongoDB Server supports any |k8s| platform
5555
To learn more, see :ref:`MongoDB Kubernetes Operator Compatibility <k8s-compatibility>`.
5656

5757
How many deployments can |k8s-op-full| support?
58-
-----------------------------------------------
58+
--------------------------------------------------------------
5959

6060
|k8s-op-short| can support up to 50 deployments. However, changes made to
6161
large numbers of deployments at the same time result in long reconciliation times.
6262
To avoid prolonged reconciliation times, limit a given |k8s-op-short| instance
63-
to 20 deployments. To learn more, see the :ref:`production notes <deploy_recommended-number-sets>`.
63+
to 20 deployments. To learn more, see the :ref:`Deploy the Recommended Number of MongoDB Replica Sets <deploy_recommended-number-sets>`.
6464

6565
Should I run MongoDB Server in |k8s| in the same cluster as the application using it?
66-
--------------------------------------------------------------------------------------
66+
----------------------------------------------------------------------------------------------
6767

6868
To help minimize latency, consider colocating your database and applications on
6969
the same |k8s| cluster if your deployment architecture allows this.
7070

7171
Can I deploy MongoDB Server across multiple |k8s| clusters?
72-
-----------------------------------------------------------
72+
-----------------------------------------------------------------------
7373

7474
Yes. To learn more, see :ref:`Deploy MongoDB Resources on Multiple Kubernetes Clusters <multi-cluster>`.
7575
For help, contact |mdb-support|.
76+
77+
What is the difference between using the |k8s-op-short| for managing |multi-clusters| and managing a single |k8s| cluster?
78+
-----------------------------------------------------------------------------------------------------------------------------------
79+
80+
To use the |k8s-op-short| for managing a |multi-cluster|, you must set up a specific set of
81+
|k8s| :k8sdocs:`Roles, ClusterRoles </reference/access-authn-authz/rbac/#role-and-clusterrole>`,
82+
:k8sdocs:`RoleBindings, ClusterRoleBindings </reference/access-authn-authz/rbac/#rolebinding-and-clusterrolebinding>`,
83+
and :k8sdocs:`ServiceAccounts </tasks/configure-pod-container/configure-service-account/>`.
84+
85+
The |k8s-op-short| used for a |multi-cluster| can also reconcile a single |k8s| cluster resource.
86+
To learn more, see :ref:`faq-many-operators`.
87+
88+
.. _faq-many-operators:
89+
90+
Does MongoDB support running more than one |k8s-op-short| instance?
91+
--------------------------------------------------------------------------------
92+
93+
If possible, we recommend that you set up a single |k8s-op-short| instance to
94+
watch one, many, or all namespaces within your |k8s| cluster. By default,
95+
the |k8s-op-short| watches all |k8s-custom-resource| types that you choose
96+
to deploy, and you don't need to configure it to watch specific resource types.
97+
98+
However, once you reach a :ref:`performance limit <deploy_recommended-number-sets>`
99+
for the number of deployments a single |k8s-op-short| instance can support,
100+
you can set up an additional |k8s-op-short| instance. At this point,
101+
consider how you want to divide up management of resources in the |k8s| cluster.
102+
Use the following recommendations listed in the order of priority:
103+
104+
- Ensure that each |k8s-op-short| instance is watching different and non-overlapping
105+
namespaces within the |k8s| cluster.
106+
- Alternatively, configure different instances of the |k8s-op-short| to watch
107+
different resource types, either in different namespaces or overlapping namespaces.
108+
109+
If you choose to use overlapping namespaces, ensure that each |k8s-op-short|
110+
instance watches different types of resources to avoid conflict that would
111+
result in two instances of the |k8s-op-short| attempting to manage
112+
the same resources.
113+
114+
.. note::
115+
116+
Before you configure another |k8s-op-short| instance, verify that none of its
117+
namespaces are included in the subset of namespaces for the existing |k8s-op-short| instance.
Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1-
Watching a subset of namespaces is useful in deployments with
2-
multiple |k8s-op-short| instances, where each |k8s-op-short| instance
3-
watches a different subset of namespaces in your cluster.
1+
Watching a subset of namespaces is useful in deployments where a single
2+
|k8s-op-short| instance watches a different cluster resource type.
3+
For example, you can configure the |k8s-op-short| to watch |k8s-mdbrscs|
4+
in one subset of namespaces, and to watch |mongodb-multis| in another
5+
subset of namespaces. To avoid race conditions during resource reconciliation,
6+
for each custom resource type that you want the |k8s-op-short| to watch,
7+
ensure that you set scope to a distinct subset of namespaces.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
.. note::
2+
3+
Install and set up a single |k8s-op-short| instance and configure it
4+
to watch one, many, or all custom resources in different, non-overlapping
5+
subsets of namespaces. See also :ref:`faq-many-operators`
Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
- Creates a default ConfigMap named ``mongodb-enterprise-operator-member-list``
22
that contains all the member clusters of the |multi-cluster|. This name is
33
hard-coded and you can't change it. See :ref:`Known Issues <hardcoded_configmap_multi-clusters>`.
4-
- Creates |k8s-service-accounts|, Roles, and RoleBindings in the central
5-
cluster and each member cluster.
4+
- Creates :k8sdocs:`ServiceAccounts </tasks/configure-pod-container/configure-service-account/>`,
5+
:k8sdocs:`Roles, ClusterRoles </reference/access-authn-authz/rbac/#role-and-clusterrole>`,
6+
:k8sdocs:`RoleBindings and ClusterRoleBindings </reference/access-authn-authz/rbac/#rolebinding-and-clusterrolebinding>`
7+
in the central cluster and each member cluster.
68
- Applies the correct permissions for service accounts.
79
- Uses the preceding settings to create your |multi-cluster|.

source/multi-cluster-prerequisites.txt

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -158,13 +158,13 @@ and :k8sdocs:`ServiceAccounts </tasks/configure-pod-container/configure-service-
158158
service accounts to your |multi-cluster| with the ``kubectl apply`` command. This may be
159159
necessary for certain highly automated workflows. MongoDB provides sample configuration files.
160160

161-
For namespace-scoped resources:
161+
For custom resources scoped to a subset of namespaces:
162162

163163
- :github-raw:`Roles, Role Bindings, and Service Accounts for your Central Cluster </mongodb/mongodb-enterprise-kubernetes/master/samples/multi-cluster-cli-gitops/resources/rbac/namespace_scoped_central_cluster.yaml>`
164164

165165
- :github-raw:`Roles, Role Bindings, and Service Accounts for your Member Clusters </mongodb/mongodb-enterprise-kubernetes/master/samples/multi-cluster-cli-gitops/resources/rbac/namespace_scoped_member_cluster.yaml>`
166166

167-
For cluster-scoped resources:
167+
For custom resources scoped to a cluster-wide namespace:
168168

169169
- :github-raw:`ClusterRoles, ClusterRoleBindings, and ServiceAccounts for your Central Cluster </mongodb/mongodb-enterprise-kubernetes/master/samples/multi-cluster-cli-gitops/resources/rbac/cluster_scoped_central_cluster.yaml>`
170170

@@ -204,7 +204,7 @@ Once the |k8s-op-short| creates the |multi-cluster|, the |k8s-op-short|
204204
starts watching |k8s-mdbrscs| in the ``mongodb`` |k8s-ns|.
205205

206206
To configure the |k8s-op-short| with the correct permissions to deploy
207-
in multiple or all namespaces, run the following command and specify the
207+
in a subset or all namespaces, run the following command and specify the
208208
namespaces that you would like the |k8s-op-short| to watch.
209209

210210
.. code-block:: sh
@@ -222,6 +222,8 @@ can configure the |k8s-op-short| to:
222222
- :ref:`Watch Resources in Multiple Namespaces <mc-cluster-many-namespaces-ref>`
223223
- :ref:`Watch Resources in All Namespaces <mc-cluster-all-namespaces-ref>`
224224

225+
.. include:: /includes/admonitions/note-k8s-non-overlapping-namespaces-for-diff-rsrc-types.rst
226+
225227
.. _mc-cluster-many-namespaces-ref:
226228

227229
Watch Resources in Multiple Namespaces
Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
:noprevnext:
2+
3+
.. _k8s-which-to-install:
4+
5+
==========================================================================================
6+
Choose |k8s-op-short| Installation Mode: Single- or Multi-|k8s| Clusters
7+
==========================================================================================
8+
9+
.. default-domain:: mongodb
10+
11+
.. contents:: On this page
12+
:local:
13+
:backlinks: none
14+
:depth: 1
15+
:class: singlecol
16+
17+
The |k8s-op-short| can manage custom resources for single- and multi-|k8s|
18+
clusters. Before you install the |k8s-op-short|, decide which type of
19+
|k8s| cluster deployment you want to support, single- or multi-|k8s| cluster.
20+
21+
.. _one-operator-for-single-k8s-cluster:
22+
23+
|k8s-op-short| Watches Single-|k8s| Cluster Resources
24+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
25+
26+
You can configure the |k8s-op-short| to watch |opsmanager-resources| and |k8s-mdbrscs|
27+
for a replica set or a sharded cluster in a single |k8s| cluster.
28+
For steps, see :ref:`Install the Operator <install-k8s-operator>`.
29+
30+
.. _one-operator-for-multi-k8s-clusters:
31+
32+
|k8s-op-short| Watches Multi-|k8s| Cluster Resources
33+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
34+
35+
You can configure the |k8s-op-short| to watch |opsmanager-resources|, |k8s-mdbrscs|,
36+
and |mongodb-multis| for a replica set in a multi-|k8s| cluster. For steps,
37+
see :ref:`Multi-Kubernetes-Cluster Quick Start <multi-cluster-quick-start-ref>`.
38+
39+
.. _one-operator-for-single-and-multi-k8s-clusters:
40+
41+
|k8s-op-short| Watches Resources in a Single- and Multi-|k8s| Cluster
42+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
43+
44+
You can configure the |k8s-op-short| to watch the following types of |k8s-crds|:
45+
46+
- |k8s-mdbrscs|
47+
- |opsmanager-resources|
48+
- |mongodbusers|
49+
- |mongodb-multis|
50+
51+
Depending on the watched resources, the |k8s-op-short| reconciles resources
52+
based on the given |k8s-crd|.
53+
54+
To support custom resources deployed in single- and multi-|k8s| clusters,
55+
set up one instance of the |k8s-op-short| that will watch for and reconcile
56+
custom resources for a single |k8s| cluster and a |multi-cluster|.
57+
Use different non-overlapping subsets of namespaces for each type of resource.
58+
59+
Set ``.Values.operator.watchedResources`` as follows:
60+
61+
.. code-block:: yaml
62+
63+
-watch-resource=MongoDB \
64+
-watch-resource=OpsMnagers \
65+
-watch-resource=MongoDBusers \
66+
-watch-resource=MongoDBMultiCluster
67+
68+
.. include:: /includes/admonitions/note-k8s-non-overlapping-namespaces-for-diff-rsrc-types.rst
69+
70+
Next Steps
71+
----------
72+
73+
After deciding how you want to install the |k8s-op-short|, you can:
74+
75+
- Set the :ref:`scope of your deployments <k8s-deployment-scopes>` for
76+
single |k8s| clusters, or :ref:`set the multi-Kubernetes cluster deployment's scope <mc-namespace-scope-ref>`.
77+
- Install single-|k8s| cluster. For single-|k8s| clusters, review the
78+
:ref:`considerations <k8s-considerations>`, complete the :ref:`prerequisites <k8s-prerequisites>`
79+
and :ref:`install the Kubernetes Operator <install-k8s-operator>`.
80+
- Install the |k8s-op-short| in a |multi-cluster|. See the :ref:`Multi-Kubernetes-Cluster Quick Start <multi-cluster-quick-start-ref>`.

source/tutorial/plan-k8s-operator-install.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,10 @@ resources.
3838
:ref:`Container Images <k8s-container-images>`
3939
Review container image details.
4040

41+
:ref:`Single- or Multi-Kubernetes Clusters <k8s-which-to-install>`
42+
Decide whether to set up single or multiple |k8s| clusters for your custom
43+
MongoDB resources.
44+
4145
:ref:`Set Deployment Scope <k8s-deployment-scopes>`
4246
Set the scope for the |k8s-op-short| deployment by configuring which
4347
type of namespace the |k8s-op-short| should use.
@@ -57,6 +61,7 @@ resources.
5761
Architecture </tutorial/plan-k8s-op-architecture>
5862
Compatibility </tutorial/plan-k8s-op-compatibility>
5963
Container Images </tutorial/plan-k8s-op-container-images>
64+
Single- or Multi-Kubernetes Clusters </tutorial/plan-k8s-install-single-or-multi-clusters>
6065
Set Deployment Scope </tutorial/set-scope-k8s-operator>
6166
/tutorial/plan-k8s-op-considerations
6267
/tutorial/plan-k8s-op-prerequisites

0 commit comments

Comments
 (0)