@@ -140,26 +140,18 @@ instructions for your preferred installation method.
140
140
</mongodb/mongodb-enterprise-kubernetes/blob/master/mongodb-enterprise.yaml>`
141
141
sample |yaml| file from the :github:`MongoDB Enterprise Kubernetes Operator GitHub repository
142
142
</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: "*"
160
152
161
153
#. 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>`,
163
155
change:
164
156
165
157
.. code-block:: sh
@@ -192,7 +184,7 @@ instructions for your preferred installation method.
192
184
- watch
193
185
194
186
#. 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>`,
196
188
change:
197
189
198
190
.. code-block:: sh
@@ -229,45 +221,62 @@ instructions for your preferred installation method.
229
221
name: mongodb-enterprise-operator
230
222
namespace: mongodb
231
223
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
+
236
229
.. literalinclude:: /includes/service-accounts-and-secrets-cluster-wide-no-helm.yaml
237
230
:language: yaml
238
231
:linenos:
239
232
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
+
240
258
.. tab:: Using Helm
241
259
:tabid: k8s-with-helm
242
260
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:
244
263
245
264
1. Configure the |k8s-op-short| to watch all namespaces:
246
265
247
266
.. code-block:: sh
248
267
249
268
helm install enterprise-operator mongodb/enterprise-operator \
250
- --set operator.watchNamespace=*
269
+ --set operator.watchNamespace="*"
251
270
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|:
258
272
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
264
274
265
275
.. code-block:: sh
266
276
267
277
helm template mongodb/enterprise-operator \
268
278
--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 -
271
280
272
281
.. tab:: OpenShift
273
282
:tabid: os
@@ -277,7 +286,8 @@ instructions for your preferred installation method.
277
286
.. tab:: Using oc
278
287
:tabid: openshift-no-helm
279
288
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:
281
291
282
292
1. Use the :github:`mongodb-enterprise-openshift.yaml
283
293
</mongodb/mongodb-enterprise-kubernetes/blob/master/mongodb-enterprise-openshift.yaml>`
@@ -286,24 +296,17 @@ instructions for your preferred installation method.
286
296
287
297
#. Set the ``spec.template.spec.containers.name.env.name:WATCH_NAMESPACE`` in
288
298
: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.
291
302
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
297
304
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: "*"
303
306
304
307
#. Create the corresponding roles for these accounts. In
305
308
: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>`,
307
310
change:
308
311
309
312
.. code-block:: sh
@@ -336,7 +339,7 @@ instructions for your preferred installation method.
336
339
- watch
337
340
338
341
#. 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>`,
340
343
change:
341
344
342
345
.. code-block:: sh
@@ -377,72 +380,65 @@ instructions for your preferred installation method.
377
380
deploy the |k8s-op-short|.
378
381
If you deploy MongoDB resources in :ref:`multiple namespaces
379
382
<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|
381
384
synchronizes the secret across all watched namespaces.
382
385
To learn more, see the ``registry.imagePullSecrets``
383
386
setting in the :doc:`Helm installation settings</reference/helm-operator-settings>`.
384
387
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.
390
392
391
393
.. literalinclude:: /includes/service-accounts-and-secrets-cluster-wide-no-helm.yaml
392
394
:language: yaml
393
395
:linenos:
394
396
397
+ #. Create local |k8s| |k8s-service-accounts|:
398
+
399
+ .. include:: /includes/facts/fact-service-accounts-and-namespaces.rst
400
+
395
401
.. tab:: Using Helm
396
402
:tabid: openshift-helm
397
403
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:
399
406
400
407
1. Configure the |k8s-op-short| to watch all namespaces:
401
408
402
409
.. code-block:: sh
403
410
404
411
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="*" \
426
413
427
414
#. Create the secret only in the namespace where you will
428
415
deploy the |k8s-op-short|.
429
416
If you deploy MongoDB resources in :ref:`multiple namespaces
430
417
<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|
432
419
synchronizes the secret across all watched namespaces.
433
420
To learn more, see the ``registry.imagePullSecrets``
434
421
setting in the :doc:`Helm installation settings</reference/helm-operator-settings>`.
435
422
436
- In the following sample | yaml| file, replace ``<namespace>``
423
+ In the ``mongodb-enterprise. yaml`` file, replace ``<namespace>``
437
424
with the namespace in which you want to install the
438
425
|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.
441
427
442
428
.. literalinclude:: /includes/service-accounts-and-secrets-cluster-wide.yaml
443
429
:language: yaml
444
430
:linenos:
445
431
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
+
446
442
Next Steps
447
443
----------
448
444
0 commit comments