Skip to content

Commit f18dd3f

Browse files
authored
(DOCSP-23815) Updates to cluster-wide scope instructions for MEKO single clusters … (#1015)
* (DOCSP-23815) Updates to cluster-wide scope instructions for MEKO single clusters * Added examples for watch namespace * Add double quotes in two more places * Fixed one more thing on lines 333-334 * Copy review, now requires another tech review * Edits * Ready for reviews again
1 parent c4b1104 commit f18dd3f

File tree

3 files changed

+95
-87
lines changed

3 files changed

+95
-87
lines changed
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
For each namespace, create some or all of the following
2+
local |k8s| |k8s-service-accounts|:
3+
4+
- If you want to deploy a MongoDB instance in the
5+
namespace, use ``mongodb-enterprise-database-pods``.
6+
7+
- If you want to deploy |onprem| in the namespace, use
8+
``mongodb-enterprise-appdb`` and ``mongodb-enterprise-ops-manager``.
9+
10+
Copy and paste the applicable examples and replace the ``<namespace>``
11+
value with the label that identifies the namespace.

source/multi-cluster-quick-start-prerequisites.txt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,8 @@ to watch |k8s-mdbrscs| in all namespaces in the |multi-cluster|.
251251
#. Set the ``spec.template.spec.containers.name.env.name:WATCH_NAMESPACE``
252252
in :github:`mongodb-enterprise.yaml
253253
</mongodb/mongodb-enterprise-kubernetes/blob/master/mongodb-enterprise.yaml>`
254-
to ``*``:
254+
to ``"*"``. You must include the double quotation marks (``"``)
255+
around the asterisk (``*``) in the YAML file.
255256

256257
.. code-block:: sh
257258

@@ -274,7 +275,7 @@ to watch |k8s-mdbrscs| in all namespaces in the |multi-cluster|.
274275
--set operator.name=mongodb-enterprise-operator-multi-cluster \
275276
--set operator.createOperatorServiceAccount=false \
276277
--set "multiCluster.clusters=$MDB_CLUSTER_1_FULL_NAME,$MDB_CLUSTER_2_FULL_NAME,$MDB_CLUSTER_3_FULL_NAME"
277-
--set ​​operator.watchNamespace="*"
278+
--set operator.watchNamespace="*"
278279

279280
.. _mc-cluster-check-connectivity-ref:
280281

source/tutorial/set-scope-k8s-operator.txt

Lines changed: 81 additions & 85 deletions
Original file line numberDiff line numberDiff line change
@@ -140,26 +140,18 @@ instructions for your preferred installation method.
140140
</mongodb/mongodb-enterprise-kubernetes/blob/master/mongodb-enterprise.yaml>`
141141
sample |yaml| file from the :github:`MongoDB Enterprise Kubernetes Operator GitHub repository
142142
</mongodb/mongodb-enterprise-kubernetes>`.
143-
#. Set the ``spec.template.spec.containers.name.env.name:WATCH_NAMESPACE`` in
144-
:github:`mongodb-enterprise.yaml
145-
</mongodb/mongodb-enterprise-kubernetes/blob/master/mongodb-enterprise.yaml#L239>`
146-
to ``*``.
147-
148-
#. Create the following local |k8s| |k8s-service-accounts|
149-
for each namespace where you want to deploy |onprem| and
150-
|k8s-mdbrscs|:
151-
152-
- ``mongodb-enterprise-database-pods``, if deploying a
153-
MongoDB instance in the namespace.
154-
155-
- ``mongodb-enterprise-appdb``, if deploying |onprem| in
156-
the namespace.
157-
158-
- ``mongodb-enterprise-ops-manager``, if deploying
159-
|onprem| in the namespace.
143+
#. Set the ``spec.template.spec.containers.name.env.name:WATCH_NAMESPACE``
144+
in :github:`mongodb-enterprise.yaml
145+
</mongodb/mongodb-enterprise-kubernetes/blob/master/mongodb-enterprise.yaml>`
146+
to ``"*"``. You must include the double quotation marks
147+
(``"``) around the asterisk (``*``) in the |yaml| file.
148+
149+
.. code-block:: sh
150+
151+
WATCH_NAMESPACE: "*"
160152

161153
#. In :github:`mongodb-enterprise.yaml
162-
</mongodb/mongodb-enterprise-kubernetes/blob/master/mongodb-enterprise.yaml#L56>`,
154+
</mongodb/mongodb-enterprise-kubernetes/blob/master/mongodb-enterprise.yaml>`,
163155
change:
164156

165157
.. code-block:: sh
@@ -192,7 +184,7 @@ instructions for your preferred installation method.
192184
- watch
193185

194186
#. In :github:`mongodb-enterprise.yaml
195-
</mongodb/mongodb-enterprise-kubernetes/blob/master/mongodb-enterprise.yaml#L122-134>`,
187+
</mongodb/mongodb-enterprise-kubernetes/blob/master/mongodb-enterprise.yaml>`,
196188
change:
197189

198190
.. code-block:: sh
@@ -229,45 +221,62 @@ instructions for your preferred installation method.
229221
name: mongodb-enterprise-operator
230222
namespace: mongodb
231223

232-
#. In the following sample |yaml| file, replace ``<namespace>``
233-
with the namespace in which you want the |k8s-op-short|
234-
to deploy resources.
235-
224+
#. In the ``mongodb-enterprise.yaml`` file, change the
225+
``<namespace>`` value to the namespace where you want
226+
the |k8s-op-short| to deploy resources and apply the
227+
|yaml| fle.
228+
236229
.. literalinclude:: /includes/service-accounts-and-secrets-cluster-wide-no-helm.yaml
237230
:language: yaml
238231
:linenos:
239232

233+
#. Create local |k8s| |k8s-service-accounts|:
234+
235+
.. include:: /includes/facts/fact-service-accounts-and-namespaces.rst
236+
237+
.. code-block:: sh
238+
239+
---
240+
kind: ServiceAccount
241+
apiVersion: v1
242+
metadata:
243+
name: mongodb-enterprise-database-pods
244+
namespace: <namespace>
245+
---
246+
kind: ServiceAccount
247+
apiVersion: v1
248+
metadata:
249+
name: mongodb-enterprise-appdb
250+
namespace: <namespace>
251+
---
252+
kind: ServiceAccount
253+
apiVersion: v1
254+
metadata:
255+
name: mongodb-enterprise-ops-manager
256+
namespace: <namespace>
257+
240258
.. tab:: Using Helm
241259
:tabid: k8s-with-helm
242260

243-
Before you deploy the |k8s-op-short|, configure the following items:
261+
Before you deploy the |k8s-op-short|, configure the following
262+
items:
244263

245264
1. Configure the |k8s-op-short| to watch all namespaces:
246265

247266
.. code-block:: sh
248267

249268
helm install enterprise-operator mongodb/enterprise-operator \
250-
--set operator.watchNamespace=*
269+
--set operator.watchNamespace="*"
251270

252-
#. Create the following local |k8s| |k8s-service-accounts|
253-
for each namespace where you want to deploy |onprem| and
254-
|k8s-mdbrscs|:
255-
256-
- ``mongodb-enterprise-database-pods``, if deploying a
257-
MongoDB instance in the namespace.
271+
#. Create local |k8s| |k8s-service-accounts|:
258272

259-
- ``mongodb-enterprise-appdb``, if deploying |onprem| in
260-
the namespace.
261-
262-
- ``mongodb-enterprise-ops-manager``, if deploying
263-
|onprem| in the namespace.
273+
.. include:: /includes/facts/fact-service-accounts-and-namespaces.rst
264274

265275
.. code-block:: sh
266276

267277
helm template mongodb/enterprise-operator \
268278
--set namespace=<metadata.namespace>
269-
--show-only templates/database-roles.yaml | oc apply -f -
270-
279+
--show-only templates/database-roles.yaml | kubectl apply -f -
271280

272281
.. tab:: OpenShift
273282
:tabid: os
@@ -277,7 +286,8 @@ instructions for your preferred installation method.
277286
.. tab:: Using oc
278287
:tabid: openshift-no-helm
279288

280-
Before you deploy the |k8s-op-short|, configure the following items:
289+
Before you deploy the |k8s-op-short|, configure the following
290+
items:
281291

282292
1. Use the :github:`mongodb-enterprise-openshift.yaml
283293
</mongodb/mongodb-enterprise-kubernetes/blob/master/mongodb-enterprise-openshift.yaml>`
@@ -286,24 +296,17 @@ instructions for your preferred installation method.
286296

287297
#. Set the ``spec.template.spec.containers.name.env.name:WATCH_NAMESPACE`` in
288298
:github:`mongodb-enterprise-openshift.yaml
289-
</mongodb/mongodb-enterprise-kubernetes/blob/master/mongodb-enterprise-openshift.yaml#L236>`
290-
to ``*``.
299+
</mongodb/mongodb-enterprise-kubernetes/blob/master/mongodb-enterprise-openshift.yaml>`
300+
to ``"*"``. You must include the double quotation marks
301+
(``"``) around the asterisk (``*``) in the |yaml| file.
291302

292-
#. Create the following local |k8s| |k8s-service-accounts| for
293-
each namespace:
294-
295-
- ``mongodb-enterprise-database-pods``, if deploying a
296-
MongoDB instance in the namespace.
303+
.. code-block:: sh
297304

298-
- ``mongodb-enterprise-appdb``, if deploying |onprem| in
299-
the namespace.
300-
301-
- ``mongodb-enterprise-ops-manager``, if deploying
302-
|onprem| in the namespace.
305+
WATCH_NAMESPACE: "*"
303306

304307
#. Create the corresponding roles for these accounts. In
305308
:github:`mongodb-enterprise-openshift.yaml
306-
</mongodb/mongodb-enterprise-kubernetes/blob/master/mongodb-enterprise-openshift.yaml#L56>`,
309+
</mongodb/mongodb-enterprise-kubernetes/blob/master/mongodb-enterprise-openshift.yaml>`,
307310
change:
308311

309312
.. code-block:: sh
@@ -336,7 +339,7 @@ instructions for your preferred installation method.
336339
- watch
337340

338341
#. In :github:`mongodb-enterprise-openshift.yaml
339-
</mongodb/mongodb-enterprise-kubernetes/blob/master/mongodb-enterprise-openshift.yaml#L122-134>`,
342+
</mongodb/mongodb-enterprise-kubernetes/blob/master/mongodb-enterprise-openshift.yaml>`,
340343
change:
341344

342345
.. code-block:: sh
@@ -377,72 +380,65 @@ instructions for your preferred installation method.
377380
deploy the |k8s-op-short|.
378381
If you deploy MongoDB resources in :ref:`multiple namespaces
379382
<ns-scope-different-ns>` or with a :ref:`cluster-wide
380-
scope <cluster-wide-scope>`,the |k8s-op-short|
383+
scope <cluster-wide-scope>`, the |k8s-op-short|
381384
synchronizes the secret across all watched namespaces.
382385
To learn more, see the ``registry.imagePullSecrets``
383386
setting in the :doc:`Helm installation settings</reference/helm-operator-settings>`.
384387

385-
In the following sample |yaml| file, replace ``<namespace>``
386-
with the namespace in which you want to install the
387-
|k8s-op-short|. Use |oc| or the OpenShift Container
388-
Platform user interface to apply the resulting |yaml|
389-
file.
388+
In the ``mongodb-enterprise.yaml`` file, replace
389+
``<namespace>`` with the namespace in which you want to
390+
install the |k8s-op-short|. Use |oc| or the OpenShift
391+
Container Platform UI to apply the resulting |yaml| file.
390392

391393
.. literalinclude:: /includes/service-accounts-and-secrets-cluster-wide-no-helm.yaml
392394
:language: yaml
393395
:linenos:
394396

397+
#. Create local |k8s| |k8s-service-accounts|:
398+
399+
.. include:: /includes/facts/fact-service-accounts-and-namespaces.rst
400+
395401
.. tab:: Using Helm
396402
:tabid: openshift-helm
397403

398-
Before you deploy the |k8s-op-short|, configure the following items:
404+
Before you deploy the |k8s-op-short|, configure the following
405+
items:
399406

400407
1. Configure the |k8s-op-short| to watch all namespaces:
401408

402409
.. code-block:: sh
403410

404411
helm install enterprise-operator mongodb/enterprise-operator \
405-
--set operator.watchNamespace=* \
406-
407-
#. Create the following local |k8s-service-accounts| for each
408-
namespace where you want to deploy |onprem| and
409-
|k8s-mdbrscs|:
410-
411-
- ``mongodb-enterprise-database-pods``, if deploying a
412-
MongoDB instance in the namespace.
413-
414-
- ``mongodb-enterprise-appdb``, if deploying |onprem| in
415-
the namespace.
416-
417-
- ``mongodb-enterprise-ops-manager``, if deploying
418-
|onprem| in the namespace.
419-
420-
.. code-block:: sh
421-
422-
helm template mongodb/enterprise-operator \
423-
--set namespace=<metadata.namespace>
424-
--show-only templates/database-roles.yaml | oc apply -f -
425-
412+
--set operator.watchNamespace="*" \
426413

427414
#. Create the secret only in the namespace where you will
428415
deploy the |k8s-op-short|.
429416
If you deploy MongoDB resources in :ref:`multiple namespaces
430417
<ns-scope-different-ns>` or with a :ref:`cluster-wide
431-
scope <cluster-wide-scope>`,the |k8s-op-short|
418+
scope <cluster-wide-scope>`, the |k8s-op-short|
432419
synchronizes the secret across all watched namespaces.
433420
To learn more, see the ``registry.imagePullSecrets``
434421
setting in the :doc:`Helm installation settings</reference/helm-operator-settings>`.
435422

436-
In the following sample |yaml| file, replace ``<namespace>``
423+
In the ``mongodb-enterprise.yaml`` file, replace ``<namespace>``
437424
with the namespace in which you want to install the
438425
|k8s-op-short|. Use |oc| or the OpenShift Container
439-
Platform user interface to apply the resulting |yaml|
440-
file.
426+
Platform UI to apply the resulting |yaml| file.
441427

442428
.. literalinclude:: /includes/service-accounts-and-secrets-cluster-wide.yaml
443429
:language: yaml
444430
:linenos:
445431

432+
#. Create local |k8s| |k8s-service-accounts|:
433+
434+
.. include:: /includes/facts/fact-service-accounts-and-namespaces.rst
435+
436+
.. code-block:: sh
437+
438+
helm template mongodb/enterprise-operator \
439+
--set namespace=<metadata.namespace>
440+
--show-only templates/database-roles.yaml | oc apply -f -
441+
446442
Next Steps
447443
----------
448444

0 commit comments

Comments
 (0)