Skip to content

Commit f6a5738

Browse files
(DOCSP-7849): Backup support in OM resource
1 parent 9786683 commit f6a5738

12 files changed

+599
-38
lines changed

conf.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,8 @@
203203
'website': ('https://www.mongodb.com%s?jmp=docs',''),
204204
'k8sdocs': ('https://kubernetes.io/docs%s', ''),
205205
'v1.2': ('https://docs.mongodb.com/kubernetes-operator/v1.2%s', ''),
206-
'gh' : ('https://github.com%s', '')
206+
'gh' : ('https://github.com%s', ''),
207+
'aws': ('http://docs.aws.amazon.com%s', '')
207208
}
208209

209210
intersphinx_mapping = {}

source/configure-k8s-operator-for-mdb-resources.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
:noprevnext:
22

3+
.. _configure-k8s-op-mdb-resources:
4+
35
==================================================
46
Configure the |k8s-op-short| for MongoDB Resources
57
==================================================

source/includes/admonition-om-resource-alpha.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.. admonition:: Alpha Release of |onprem| Resource
1+
.. admonition:: Beta Release of |onprem| Resource
22
:class: important
33

44
Don't use the |onprem| resource in
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
If you enable ``SCRAM`` authentication on the oplog database, you
2+
must:
3+
4+
- Specify a MongoDB version earlier than v4.0 in the oplog database
5+
resource definition.
6+
- Create a MongoDB user resource to connect |onprem| to the oplog
7+
database.
8+
- Specify the :opsmgrkube:`~spec.backup.opLogStores.mongodbUserRef.name`
9+
of the user in the |onprem| resource definition.

source/includes/options-k8s-shared.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -409,7 +409,6 @@ description: |
409409
this storage type as a |k8s-sc| object before using it in this
410410
|k8s-obj| specification.
411411
412-
413412
.. note::
414413
415414
.. include:: /includes/fact-reclaimpolicy-to-retain.rst

source/includes/steps-deploy-k8s-opsmgr.yaml

Lines changed: 232 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ content: |
1010
1111
.. literalinclude:: /reference/k8s/example-opsmgr-minimal.yaml
1212
:language: yaml
13-
:emphasize-lines: 5,7-11,13-14
13+
:linenos:
14+
:emphasize-lines: 5,7-11,13,15,17-19,21,23-25,27-31,34-35
1415
1516
---
1617
title: "Open your preferred text editor and paste the |k8s-obj| specification into a new text file."
@@ -75,6 +76,82 @@ content: |
7576
7677
- ``om-admin-secret``
7778
79+
* - | ``spec``
80+
| ``.backup``
81+
| ``.``:opsmgrkube:`~spec.backup.enabled`
82+
- boolean
83+
- | Flag that indicates that Backup is enabled for your |onprem| resource.
84+
| You must specify ``spec.backup.enabled: true`` to configure
85+
settings for the head database, oplog store, and snapshot
86+
store.
87+
- ``true``
88+
89+
* - | ``spec``
90+
| ``.backup``
91+
| ``.opLogStores``
92+
| ``.``:opsmgrkube:`~spec.backup.opLogStores.name`
93+
- string
94+
- Name of the oplog store.
95+
- ``oplog1``
96+
97+
* - | ``spec``
98+
| ``.backup``
99+
| ``.opLogStores``
100+
| ``.mongodbRef``
101+
| ``.``:opsmgrkube:`~spec.backup.opLogStores.mongodbResourceRef.name`
102+
- string
103+
- Name of the MongoDB database resource for the oplog store.
104+
- ``my-oplog-db``
105+
106+
* - | ``spec``
107+
| ``.backup``
108+
| ``.s3Stores``
109+
| ``.``:opsmgrkube:`~spec.backup.s3Stores.name`
110+
- string
111+
- Name of the |s3| snapshot store.
112+
- ``s3store1``
113+
114+
* - | ``spec``
115+
| ``.backup``
116+
| ``.s3Stores``
117+
| ``.mongodbResourceRef``
118+
| ``.``:opsmgrkube:`~spec.backup.s3Stores.mongodbResourceRef.name`
119+
- string
120+
- Name of the MongoDB database resource for the |s3| snapshot
121+
store metadata.
122+
- ``my-s3-metadata-db``
123+
124+
* - | ``spec``
125+
| ``.backup``
126+
| ``.s3Stores``
127+
| ``.s3SecretRef``
128+
| ``.``:opsmgrkube:`~spec.backup.s3Stores.s3SecretRef.name`
129+
- string
130+
- Name of the |k8s-secret| that contains the ``accessKey`` and
131+
``secretKey`` fields. The :ref:`backup-daemon` uses the values
132+
of these fields as credentials to
133+
access the |s3| or |s3|-compatible bucket.
134+
- ``my-s3-credentials``
135+
136+
* - | ``spec``
137+
| ``.backup``
138+
| ``.s3Stores``
139+
| ``.``:opsmgrkube:`~spec.backup.s3Stores.s3BucketEndpoint`
140+
- string
141+
- |url| of the |s3| or |s3|-compatible bucket that
142+
:opsmgr:`stores </tutorial/manage-s3-blockstore-storage>` the
143+
database Backup snapshots.
144+
- ``s3.us-east-1.amazonaws.com``
145+
146+
* - | ``spec``
147+
| ``.backup``
148+
| ``.s3Stores``
149+
| ``.``:opsmgrkube:`~spec.backup.s3Stores.s3BucketName`
150+
- string
151+
- Name of the |s3| or |s3|-compatible bucket that stores the
152+
database Backup snapshots.
153+
- my-bucket
154+
78155
* - | ``spec``
79156
| ``.applicationDatabase``
80157
| ``.``:setting:`~spec.members`
@@ -165,6 +242,12 @@ content: |
165242
- ``spec.applicationDatabase.podSpec.``:setting:`~spec.podSpec.nodeAffinity`
166243
- ``spec.applicationDatabase.passwordSecretKeyRef.``:opsmgrkube:`~spec.applicationDatabase.passwordSecretKeyRef.name`
167244
- ``spec.applicationDatabase.passwordSecretKeyRef.``:opsmgrkube:`~spec.applicationDatabase.passwordSecretKeyRef.key`
245+
- ``spec.backup.``:opsmgrkube:`~spec.backup.headDB` ``.labelSelector``
246+
- ``spec.backup.``:opsmgrkube:`~spec.backup.headDB` ``.storage``
247+
- ``spec.backup.``:opsmgrkube:`~spec.backup.headDB` ``.storageClass``
248+
- ``spec.backup.opLogStores.mongodbUserRef.``:opsmgrkube:`~spec.backup.opLogStores.mongodbUserRef.name`
249+
- ``spec.backup.s3Stores.mongodbUserRef.``:opsmgrkube:`~spec.backup.s3Stores.mongodbUserRef.name`
250+
- ``spec.backup.s3Stores.``:opsmgrkube:`~spec.backup.s3Stores.pathStyleAccessEnabled`
168251
169252
---
170253
title: "Save this file with a ``.yaml`` file extension."
@@ -215,7 +298,7 @@ content: |
215298
version: ""
216299
opsManager:
217300
lastTransition: "2019-11-15T19:48:01Z"
218-
message: Ops Manager is still waiting to start
301+
message: Ops Manager is still starting
219302
phase: Reconciling
220303
version: ""
221304
@@ -225,24 +308,29 @@ content: |
225308
.. code-block:: yaml
226309
:copyable: false
227310
228-
status:
229-
applicationDatabase:
230-
lastTransition: "2019-11-05T17:26:42Z"
231-
phase: Running
232-
type: ""
233-
version: 4.0.7
234-
opsManager:
235-
lastTransition: "2019-11-05T17:26:34Z"
236-
phase: Running
237-
replicas: 1
238-
url: http://om-test-svc.dev.svc.cluster.local:8080
239-
version: 4.2.0
240-
241-
The ``status.opsManager.url`` is the connection URL of the resource,
242-
which can be used to reach |onprem| from inside the |k8s|
243-
cluster.
244-
245-
If the deployment fails, see :doc:`/reference/troubleshooting`.
311+
status:
312+
applicationDatabase:
313+
lastTransition: "2019-12-06T18:23:22Z"
314+
members: 3
315+
phase: Running
316+
type: ReplicaSet
317+
version: 4.0.7
318+
opsManager:
319+
lastTransition: "2019-12-06T18:23:26Z"
320+
message: The MongoDB object namespace/oplogdbname doesn't exist
321+
phase: Pending
322+
url: http://om-svc.dev.svc.cluster.local:8080
323+
version: ""
324+
325+
The |application| remains in a ``Pending`` state until you configure
326+
the Backup databases.
327+
328+
.. tip::
329+
330+
The ``status.opsManager.url`` field states the resource's
331+
connection |url|. Using this |url|, you can reach |onprem| from
332+
inside the |k8s| cluster or :ref:`create a project using a
333+
ConfigMap <create-k8s-project>`.
246334
247335
---
248336
title: "Access your |onprem| instance from a browser."
@@ -254,8 +342,8 @@ content: |
254342
a. After the resource deploys successfully, find the external port to
255343
your |onprem| instance.
256344
257-
Invoke the following ``kubectl`` command on ``<metadata.name>-svc-external``:
258-
``metadata.name`` :
345+
Invoke the following ``kubectl`` command on
346+
``<metadata.name>-svc-external : <metadata.name>`` :
259347
260348
.. code-block:: sh
261349
@@ -277,9 +365,131 @@ content: |
277365
using the |fqdn| and port number.
278366
279367
.. code-block:: sh
368+
:copyable: false
280369
281370
http://ops.example.com:30036
282371
283372
#. Log in to |onprem| using the :ref:`admin user credentials
284373
<om-rsrc-prereqs>`.
374+
375+
---
376+
title: "Create credentials for the Kubernetes Operator."
377+
stepnum: 9
378+
level: 4
379+
ref: create-credentials
380+
content: |
381+
382+
To configure credentials, you must create an |onprem| organization,
383+
generate programmatic API keys, and create a |k8s-secret|. These
384+
activities follow the prerequisites and procedure on the
385+
:ref:`create-k8s-credentials` page.
386+
387+
---
388+
title: "Create a project using a |k8s-configmap|."
389+
stepnum: 10
390+
level: 4
391+
ref: create-project
392+
content: |
393+
394+
To create a project, follow the prerequisites and procedure on the
395+
:ref:`create-k8s-project` page.
396+
397+
You must set ``data.baseUrl`` in the ConfigMap to the |application|\'s |url|. To find this |url|, invoke the following command:
398+
399+
.. code-block:: sh
400+
401+
kubectl get om -n <namespace> -o yaml -w
402+
403+
The command returns the URL of the |application| in the
404+
``status.opsManager.url`` field.
405+
406+
.. code-block:: yaml
407+
:copyable: false
408+
:emphasize-lines: 12
409+
410+
status:
411+
applicationDatabase:
412+
lastTransition: "2019-12-06T18:23:22Z"
413+
members: 3
414+
phase: Running
415+
type: ReplicaSet
416+
version: 4.0.7
417+
opsManager:
418+
lastTransition: "2019-12-06T18:23:26Z"
419+
message: The MongoDB object namespace/oplogdbname doesn't exist
420+
phase: Pending
421+
url: http://om-svc.dev.svc.cluster.local:8080
422+
version: ""
423+
424+
---
425+
title: "Deploy MongoDB database resources to complete the Backup configuration."
426+
stepnum: 11
427+
level: 4
428+
ref: configure-backup
429+
content: |
430+
431+
By default, |onprem| enables :ref:`mms-backup-functional-overview`.
432+
Create a MongoDB database resource for the oplog and snapshot stores
433+
to complete the configuration.
434+
435+
a. Deploy a :ref:`MongoDB database resource
436+
<deploy-resources>` for the oplog store in the same
437+
namespace as the |onprem| resource.
438+
439+
.. note::
440+
441+
Create this database as a three-member :ref:`replica set
442+
<deploy-replica-set>`.
443+
444+
Match the ``metadata.name`` of the resource with the
445+
:opsmgrkube:`spec.backup.opLogStores.mongodbResourceRef.name` that you specified
446+
in your |onprem| resource definition.
447+
448+
#. Deploy a :ref:`MongoDB database resource
449+
<deploy-resources>` for the |s3| snapshot store in the
450+
same namespace as the |onprem| resource.
451+
452+
.. note::
453+
454+
Create the |s3| snapshot store as a replica set.
455+
456+
Match the ``metadata.name`` of the resource to the
457+
:opsmgrkube:`spec.backup.s3Stores.mongodbResourceRef.name`
458+
that you specified in your |onprem| resource definition.
459+
460+
---
461+
title: "Confirm that the |onprem| resource is running."
462+
stepnum: 12
463+
level: 4
464+
ref: confirm-running
465+
content: |
466+
467+
To check the status of your |onprem| resource, invoke the following
468+
command:
469+
470+
.. code-block:: sh
471+
472+
kubectl get om -n <namespace> -o yaml -w
473+
474+
When the |onprem| is running, the command returns the following output
475+
under the ``status`` field:
476+
477+
.. code-block:: yaml
478+
:copyable: false
479+
480+
status:
481+
applicationDatabase:
482+
lastTransition: "2019-12-06T17:46:15Z"
483+
members: 3
484+
phase: Running
485+
type: ReplicaSet
486+
version: 4.0.7
487+
opsManager:
488+
lastTransition: "2019-12-06T17:46:32Z"
489+
phase: Running
490+
replicas: 1
491+
url: http://om-backup-svc.dev.svc.cluster.local:8080
492+
version: 4.2.0
493+
494+
If the deployment fails, see :doc:`/reference/troubleshooting`.
285495
...

source/includes/toc-deploy.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
file: /tutorial/deploy-om-container
22
description: |
33
Use |k8s-op-short| to create an |onprem| instance.
4+
---
45
file: /tutorial/deploy-standalone
56
description: |
67
Use |k8s-op-short| to deploy a new standalone MongoDB instance.

0 commit comments

Comments
 (0)