Skip to content

Commit 519162c

Browse files
JuliaMongojwilliams-mongo
authored andcommitted
(DOCSP-10879) Configure OM queryable backups in k8s (#679)
* (DOCSP-10879) Configure OM queryable backups in k8s * Include initial review * Fixing the build * Edits * edits * Include copy review - 2nd pass * Fixing a syntax issue * Include Enrique's comments after running tests * fixing build errors * Adjusting the steps to clarify location * Edits * More edits * fix build * Include last comments from the copy review. Ready for the tech review * one last save * Final copy edits * Include tech review
1 parent c9e7c36 commit 519162c

File tree

4 files changed

+273
-2
lines changed

4 files changed

+273
-2
lines changed
Lines changed: 191 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,191 @@
1+
---
2+
ref: configure-kubectl-om
3+
stepnum: 1
4+
inherit:
5+
file: steps-configure-kubectl-namespace.yaml
6+
ref: configure-kubectl-namespace
7+
---
8+
stepnum: 2
9+
level: 4
10+
ref: create-pem-file
11+
title: "Create the PEM file for backups."
12+
content: |
13+
14+
Create the :opsmgr:`queryable.pem
15+
</reference/configuration/#brs.queryable.pem>`
16+
file that you will use for accessing and querying backups based on
17+
your deployment's |tls| requirements. The PEM file contains a public
18+
key certificate and its associated private key that are needed to
19+
access and run queries on |onprem| backup snapshots.
20+
21+
To learn more about the PEM file's requirements, see
22+
:opsmgr:`Authorization and Authentication Requirements
23+
</tutorial/query-backup/#authentication-and-authorization>`.
24+
25+
---
26+
stepnum: 3
27+
level: 4
28+
ref: create-queryable-pem-secret
29+
title: "Create a Secret containing the PEM file."
30+
content: |
31+
Run the following command to create a Secret with the
32+
:opsmgr:`queryable.pem </reference/configuration/#brs.queryable.pem>`
33+
file that you created in the previous step:
34+
35+
.. code-block:: sh
36+
37+
kubectl create secret generic queryable-pem --from-file=./queryable.pem
38+
39+
---
40+
title: "Mount the Secret as a volume that |onprem| custom objects will use."
41+
stepnum: 4
42+
level: 4
43+
ref: mount-pem-secret
44+
content: |
45+
46+
The |k8s-op-short| must be able to access the :opsmgr:`queryable.pem
47+
</reference/configuration/#brs.queryable.pem>` file in the mount point
48+
for the persistent volume in the Pod's container for |onprem|.
49+
50+
To mount the Secret, use one of these methods:
51+
52+
- Configure volumes using ``volumeClaimTemplates`` and specify the
53+
location for the :opsmgr:`queryable.pem
54+
</reference/configuration/#brs.queryable.pem>` file:
55+
56+
.. code-block:: yaml
57+
:linenos:
58+
:emphasize-lines: 9-35
59+
60+
apiVersion: mongodb.com/v1
61+
kind: MongoDBOpsManager
62+
metadata:
63+
name: ops-manager
64+
spec:
65+
replicas: 1
66+
version: 4.2.12
67+
adminCredentials: ops-manager-admin-secret
68+
configuration:
69+
mms.fromEmailAddr: "[email protected]"
70+
brs.queryable.pem: "/certs/queryable.pem"
71+
72+
statefulSet:
73+
spec:
74+
# the Persistent Volume Claim is created for each Ops Manager Pod
75+
volumeClaimTemplates:
76+
- metadata:
77+
name: queryable-volume
78+
spec:
79+
accessModes: [ "ReadWriteOnce" ]
80+
storageClassName: <your_storage_class_name>
81+
resources:
82+
requests:
83+
storage: 1G
84+
template:
85+
spec:
86+
containers:
87+
- name: mongodb-ops-manager
88+
volumeMounts:
89+
- name: queryable-volume
90+
- mountPath: /certs
91+
volumes:
92+
- name: queryable-pem
93+
secret:
94+
secretName: queryable-pem
95+
96+
applicationDatabase:
97+
members: 3
98+
version: 4.2.6-ent
99+
100+
- Configure volumes without using ``volumeClaimTemplates`` and specify
101+
the location for the :opsmgr:`queryable.pem
102+
</reference/configuration/#brs.queryable.pem>` file:
103+
104+
.. code-block:: yaml
105+
:linenos:
106+
:emphasize-lines: 9-24
107+
108+
apiVersion: mongodb.com/v1
109+
kind: MongoDBOpsManager
110+
metadata:
111+
name: ops-manager
112+
spec:
113+
replicas: 1
114+
version: 4.2.12
115+
adminCredentials: ops-manager-admin-secret
116+
configuration:
117+
brs.queryable.pem: "/certs/queryable.pem"
118+
mms.fromEmailAddr: "[email protected]"
119+
statefulSet:
120+
template:
121+
spec:
122+
containers:
123+
- name: mongodb-ops-manager
124+
volumeMounts:
125+
- name: queryable-volume
126+
- mountPath: /certs/
127+
128+
volumes:
129+
- name: queryable-pem
130+
secret:
131+
secretName: queryable-pem
132+
133+
applicationDatabase:
134+
members: 3
135+
version: 4.2.6-ent
136+
137+
---
138+
title: "Save your |onprem| config file."
139+
stepnum: 5
140+
level: 4
141+
ref: save-config-file
142+
143+
---
144+
title: "Apply changes to your |onprem| deployment."
145+
stepnum: 6
146+
level: 4
147+
ref: apply-queryable-backup-changes-om-k8s
148+
content: |
149+
150+
Invoke the following ``kubectl`` command on the filename of the
151+
|onprem| resource definition:
152+
153+
.. code-block:: sh
154+
155+
kubectl apply -f <opsmgr-resource>.yaml
156+
157+
When you apply the changes to your |onprem| resource
158+
definition, |k8s| updates the |onprem| StatefulSet,
159+
creates the volumes, and mounts the Secrets.
160+
161+
---
162+
stepnum: 7
163+
title: "Track the status of the mounted volumes and Secrets."
164+
level: 4
165+
ref: track-k8s-deployment-om-queryable-backup-config
166+
content: |
167+
168+
a. Obtain the list of persistent volume claims:
169+
170+
.. code-block:: sh
171+
172+
kubectl get pvc
173+
174+
#. Obtain the Secrets:
175+
176+
.. code-block:: sh
177+
178+
kubectl get secrets
179+
180+
#. Check the status of your |onprem| resources:
181+
182+
.. code-block:: sh
183+
184+
kubectl get om <resource-name> -o yaml -w
185+
186+
The ``-w`` flag means "watch". With the "watch" flag set, the
187+
output refreshes immediately when the configuration changes until
188+
the status phase achieves the ``Running`` state.
189+
190+
To learn more about the resource deployment statuses, see
191+
:doc:`/reference/troubleshooting`.

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -282,8 +282,7 @@ content: |
282282
- Name of the MongoDB database resource for the oplog store.
283283
- ``my-oplog-db``
284284
285-
You must also configure an
286-
:term:`S3 snapshot store <s3 snapshot store>`
285+
You must also configure an :term:`S3 snapshot store <s3 snapshot store>`
287286
or a :term:`blockstore <Backup Blockstore Database>`.
288287
289288
.. note::

source/om-resources.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,10 @@ Deploy and Configure Ops Manager Resources
3535
Encrypt the connection between the application database replica set
3636
members.
3737

38+
:ref:`configure-om-queryable-backups`
39+
Configure queryable backups for |onprem| deployments created with the
40+
|k8s-op-short|.
41+
3842
.. class:: hidden
3943

4044
.. toctree::
@@ -46,3 +50,4 @@ Deploy and Configure Ops Manager Resources
4650
/tutorial/deploy-om-container-remote-mode
4751
/tutorial/deploy-om-container-local-mode
4852
/tutorial/secure-om-with-tls
53+
/tutorial/configure-om-queryable-backups
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
:noprevnext:
2+
3+
.. _configure-om-queryable-backups:
4+
5+
==================================================
6+
Configure Queryable Backups for |onprem| Resources
7+
==================================================
8+
9+
.. include:: /includes/styles/corrections.rst
10+
11+
.. default-domain:: mongodb
12+
13+
.. contents:: On this page
14+
:local:
15+
:backlinks: none
16+
:depth: 2
17+
:class: singlecol
18+
19+
You can configure :opsmgr:`queryable backups </tutorial/query-backup/>`
20+
for |onprem| resources that you deploy in the |k8s-op-short|.
21+
22+
.. note:: In the |onprem| documentation, queryable backups are also
23+
referred to as queryable snapshots, or queryable restores.
24+
25+
Queryable backups allow you to :opsmgr:`run queries
26+
</tutorial/query-backup/#query-backup-handle-tls-authentication-manually>`
27+
on specific backup snapsnots from your |onprem| resources. Querying
28+
|onprem| backups helps you compare data from different snapshots
29+
and identify the best snapshot to use for :opsmgr:`restoring data
30+
</tutorial/restore-single-database/#restore-from-queryable-backup>`.
31+
32+
In the following procedure you:
33+
34+
- Create the :opsmgr:`queryable.pem
35+
</reference/configuration/#brs.queryable.pem>` file that holds the
36+
certificatesfor accessing the backup snapshots that you intend to query.
37+
38+
- Create the Secret containing the :opsmgr:`queryable.pem
39+
</reference/configuration/#brs.queryable.pem>` file.
40+
41+
- Configure a persistent volume that is attached to the |onprem|
42+
|k8s| Pod in the |k8s-op-short|.
43+
44+
- Specify the mount point for the Secret in the persistent volume's
45+
configuration.
46+
47+
- Save the |onprem| custom resource configuration and apply it.
48+
49+
Once the |k8s-op-short| deploys the updated configuration for the
50+
|onprem| custom resource, |onprem| can read the Secret from the
51+
specified location in the :opsmgr:`queryable.pem
52+
</reference/configuration/#brs.queryable.pem>` parameter in |onprem|.
53+
You can now access the backup snapshots and run queries on them.
54+
55+
Prerequisites
56+
-------------
57+
58+
Before you configure queryable backups, complete the following:
59+
60+
- :doc:`Install the Kubernetes Operator </tutorial/install-k8s-operator>`.
61+
62+
- :ref:`Deploy the Ops Manager application <deploy-om-container>`.
63+
64+
- :doc:`Configure Backup Settings for the Ops Manager Resource </tutorial/deploy-om-container>`.
65+
In the linked procedures, see the steps for configuring backups.
66+
67+
Procedure
68+
---------
69+
70+
.. include:: /includes/steps/configure-om-queryable-backups.rst
71+
72+
After you configure queryable backups, you can :opsmgr:`query them
73+
</tutorial/query-backup/>` to select the best backup snapshot to use for
74+
:opsmgr:`restoring data
75+
</tutorial/restore-single-database/#restore-from-queryable-backup>`.
76+

0 commit comments

Comments
 (0)