Skip to content

Commit 4f26c21

Browse files
(DOCSP-10246): OM Local Mode tutorial (#285)
* (DOCSP-10246): OM local mode tutorial * (DOCSP-10246): fix build * (DOCSP-10246): really fix build * (DOCSP-10246): fix warnings * (DOCSP-10246): make example values consistent with sample * (DOCSP-10246): single source om deploy prereqs * (DOCSP-10246): typo fix * (DOCSP-10246): tech review feedback * (DOCSP-10246): tech review feedback pt 2
1 parent 999f2af commit 4f26c21

9 files changed

+322
-6
lines changed

conf.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@
6363
'aagents': 'MongoDB Agents or legacy Automation Agents',
6464
'mdbagent': 'MongoDB Agent',
6565
'om-version': '4.2.6',
66-
'om-version-val': '``4.2.6``',
66+
'om-version-val': '``4.2.12``',
6767
'bndl-version': '4.2.2',
6868
'bndl-version-val': '``4.2.2-ent``',
6969
'bndl-version-example': '4.2.2-ent',
@@ -95,6 +95,7 @@
9595
'.. |cifs| replace:: :abbr:`CIFS (Common Internet File System)`',
9696
'.. |com| replace:: Cloud Manager or Ops Manager',
9797
'.. |compass| replace:: :compass:`MongoDB Compass </>`',
98+
'.. |company| replace:: MongoDB, Inc.',
9899
'.. |csr| replace:: :abbr:`CSR (Certificate Signing Request)`',
99100
'.. |csrs| replace:: :abbr:`CSRs (Certificate Signing Requests)`',
100101
'.. |dns| replace:: :abbr:`DNS (Domain Name System)`',

source/includes/deploy-om-prereqs.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
Before you deploy an |onprem| resource, make sure you :ref:`plan for
2+
your Ops Manager resource <plan-om-resource>`:
3+
4+
- Complete the :ref:`Prerequisites <om-rsrc-prereqs>`
5+
- Read the :ref:`Considerations <om-rsrc-considerations>`.
Lines changed: 207 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,207 @@
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+
title: "Copy the highlighted fields of this |onprem| resource."
9+
stepnum: 2
10+
level: 4
11+
ref: copy-k8s-example
12+
content: |
13+
14+
The highlighted section:
15+
16+
- Uses the |onprem| configuration setting
17+
``automation.versions.source: local`` in
18+
:opsmgrkube:`spec.configuration` to enable Local Mode.
19+
20+
- Defines a |k8s-pv| for the |onprem| StatefulSet to store the
21+
MongoDB installation tarball. MongoDB database resources
22+
you create with the |k8s-op-short| download these tarballs from the
23+
Persistent Volumes instead of from the Internet.
24+
25+
.. literalinclude:: /reference/k8s/example-opsmgr-local-mode.yaml
26+
:language: yaml
27+
:linenos:
28+
:emphasize-lines: 9-32
29+
30+
---
31+
title: "Paste the copied example section into your existing |onprem| resource."
32+
stepnum: 3
33+
level: 4
34+
ref: paste-k8s-example
35+
content: |
36+
37+
Open your preferred text editor and paste the |k8s-obj|
38+
specification into the appropriate location in your resource file.
39+
---
40+
title: "Save your |onprem| config file."
41+
stepnum: 4
42+
level: 4
43+
ref: save-object-spec
44+
45+
---
46+
title: "Apply changes to your |onprem| deployment."
47+
stepnum: 5
48+
level: 4
49+
ref: apply-changes-om-k8s
50+
content: |
51+
52+
Invoke the following ``kubectl`` command on the filename of the
53+
|onprem| resource definition:
54+
55+
.. code-block:: sh
56+
57+
kubectl apply -f <opsmgr-resource>.yaml
58+
59+
---
60+
title: "Track the status of your |onprem| instance."
61+
stepnum: 6
62+
level: 4
63+
ref: track-k8s-instance
64+
content: |
65+
66+
To check the status of your |onprem| resource, invoke the following
67+
command:
68+
69+
.. code-block:: sh
70+
71+
kubectl get om -o yaml -w
72+
73+
See :doc:`/reference/troubleshooting` for information about the
74+
resource deployment statuses.
75+
76+
After the |onprem| resource completes the ``Reconciling`` phase, the
77+
command returns output similar to the following:
78+
79+
.. literalinclude:: /reference/k8s/example-status-om-running-local-mode.yaml
80+
:language: yaml
81+
:copyable: false
82+
:linenos:
83+
:emphasize-lines: 12,14
84+
85+
Copy the value of the ``status.opsManager.url`` field, which states
86+
the resource's connection |url|. You use this value when you create a
87+
|k8s-configmap| later in the procedure.
88+
---
89+
title: "Download the MongoDB installation tarball to your local machine."
90+
level: 4
91+
ref: download-mdb-tarball
92+
stepnum: 7
93+
content: |
94+
95+
The installer you download depends on the environment to which
96+
you deployed the operator:
97+
98+
.. tabs::
99+
100+
.. tab:: Vanilla Kubernetes
101+
:tabid: k8s
102+
103+
Download the Ubuntu 16.04 installer for the MongoDB version you
104+
want the |k8s-op-short| to deploy. For example, to download the
105+
``4.2.0`` release:
106+
107+
.. code-block:: sh
108+
109+
curl -OL https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-ubuntu1604-4.2.0.tgz
110+
111+
.. tab:: OpenShift
112+
:tabid: os
113+
114+
Download the RHEL 7 installer for the MongoDB version you
115+
want the |k8s-op-short| to deploy. For example, to download the
116+
``4.2.0`` release:
117+
118+
.. code-block:: sh
119+
120+
curl -OL https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-rhel70-4.2.0.tgz
121+
122+
---
123+
124+
title: "Copy the MongoDB installation tarball to the |onprem| Persistent Volume for each |onprem| :opsmgrkube:`replica <spec.replicas>` you deployed."
125+
level: 4
126+
ref: copy-mdb-tarball
127+
stepnum: 8
128+
content: |
129+
130+
The command you use depends on the environment to which you deployed
131+
the operator:
132+
133+
.. note::
134+
135+
Only copy the MongoDB installation file to ``Replica 1`` and beyond
136+
if you deployed more than one |onprem| :opsmgrkube:`replica
137+
<spec.replicas>`.
138+
139+
.. tabs::
140+
141+
.. tab:: Vanilla Kubernetes
142+
:tabid: k8s
143+
144+
To copy the MongoDB ``4.2.0`` installation tarball to the
145+
|onprem| PersistentVolume:
146+
147+
Replica 0:
148+
149+
.. code-block:: sh
150+
151+
kubectl cp mongodb-linux-x86_64-ubuntu1604-4.2.0.tgz \
152+
"ops-manager-localmode-0:/mongodb-ops-manager/mongodb-releases/mongodb-linux-x86_64-ubuntu1604-4.2.0.tgz"
153+
154+
Replica 1:
155+
156+
.. code-block:: sh
157+
158+
kubectl cp mongodb-linux-x86_64-ubuntu1604-4.2.0.tgz \
159+
"ops-manager-localmode-1:/mongodb-ops-manager/mongodb-releases/mongodb-linux-x86_64-ubuntu1604-4.2.0.tgz"
160+
161+
.. tab:: OpenShift
162+
:tabid: os
163+
164+
To copy the MongoDB ``4.2.0`` installation tarball to the
165+
|onprem| PersistentVolume:
166+
167+
Replica 0:
168+
169+
.. code-block:: sh
170+
171+
oc rsync "ops-manager-localmode-0:/mongodb-ops-manager/mongodb-releases/mongodb-linux-x86_64-rhel70-4.2.0.tgz" \
172+
mongodb-linux-x86_64-rhel70-4.2.0.tgz
173+
174+
Replica 1:
175+
176+
.. code-block:: sh
177+
178+
oc rsync "ops-manager-localmode-1:/mongodb-ops-manager/mongodb-releases/mongodb-linux-x86_64-rhel70-4.2.0.tgz" \
179+
mongodb-linux-x86_64-rhel70-4.2.0.tgz
180+
---
181+
title: "Deploy a MongoDB Database Resource."
182+
level: 4
183+
ref: deploy-mdb-resource
184+
stepnum: 9
185+
content: |
186+
187+
a. If you have not done so already, complete the following
188+
prerequisites:
189+
190+
- :doc:`/tutorial/create-operator-credentials`
191+
- :doc:`/tutorial/create-project-using-configmap`
192+
193+
#. Deploy a :ref:`MongoDB database resource <k8s-deploy-mdb-resources>`
194+
in the same namespace to which you deployed |onprem|.
195+
Ensure that you:
196+
197+
i. Match the ``spec.opsManager.configMapRef.name`` of the resource
198+
to the ``metadata.name`` of your ConfigMap.
199+
#. Match the ``spec.credentials`` of the resource to the name of
200+
the secret you created that contains an |onprem| programmatic
201+
API key pair.
202+
203+
The |k8s-op-short| downloads the installation tarballs for
204+
the MongoDB Database resources from the |onprem| Persistent Volumes
205+
instead of from the Internet.
206+
207+
...

source/om-resources.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,15 @@ Deploy and Configure Ops Manager Resources
1515
:ref:`deploy-om-container`
1616
Use the |k8s-op-short| to deploy an |onprem| instance.
1717

18+
:ref:`deploy-om-container-local-mode`
19+
Use the the |k8s-op-short| to deploy an |onprem| instance if the nodes
20+
in your |k8s| cluster don't have access to the Internet.
21+
1822
.. class:: hidden
1923

2024
.. toctree::
2125
:titlesonly:
2226

2327
/tutorial/plan-om-resource
2428
/tutorial/deploy-om-container
29+
/tutorial/deploy-om-container-local-mode
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
apiVersion: mongodb.com/v1
2+
kind: MongoDBOpsManager
3+
metadata:
4+
name: ops-manager-localmode
5+
spec:
6+
replicas: 2
7+
version: 4.2.12
8+
adminCredentials: ops-manager-admin-secret
9+
configuration:
10+
# this enables local mode in Ops Manager
11+
automation.versions.source: local
12+
13+
statefulSet:
14+
spec:
15+
# the Persistent Volume Claim will be created for each Ops Manager Pod
16+
volumeClaimTemplates:
17+
- metadata:
18+
name: mongodb-versions
19+
spec:
20+
accessModes: [ "ReadWriteOnce" ]
21+
resources:
22+
requests:
23+
storage: 20G
24+
template:
25+
spec:
26+
containers:
27+
- name: mongodb-ops-manager
28+
volumeMounts:
29+
- name: mongodb-versions
30+
# this is the directory in each Pod where all MongoDB
31+
# archives must be put
32+
mountPath: /mongodb-ops-manager/mongodb-releases
33+
34+
35+
backup:
36+
enabled: false
37+
38+
applicationDatabase:
39+
members: 3
40+
persistent: true
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
status:
2+
applicationDatabase:
3+
lastTransition: "2020-05-15T16:20:22Z"
4+
members: 3
5+
phase: Running
6+
type: ReplicaSet
7+
version: 4.2.2-ent
8+
backup:
9+
phase: ""
10+
opsManager:
11+
lastTransition: "2020-05-15T16:20:26Z"
12+
phase: Running
13+
replicas: 1
14+
url: http://ops-manager-localmode-svc.mongodb.svc.cluster.local:8080
15+
version: 4.2.12
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
:noprevnext:
2+
3+
.. _deploy-om-container-local-mode:
4+
5+
================================================
6+
Configure an |onprem| Resource to use Local Mode
7+
================================================
8+
9+
.. default-domain:: mongodb
10+
11+
.. contents:: On this page
12+
:local:
13+
:backlinks: none
14+
:depth: 2
15+
:class: singlecol
16+
17+
.. include:: /includes/styles/corrections.rst
18+
19+
In a default configuration, the {+mdbagent+}\s and Backup Daemons
20+
access MongoDB installation tarballs over the Internet from |company|
21+
22+
You can configure |onprem| to run in **Local Mode** with the
23+
|k8s-op-short| if the nodes in your |k8s| cluster don't have access to
24+
the Internet. The Backup Daemons and managed MongoDB resources download
25+
installation tarballs only from |onprem|.
26+
27+
This procedure covers uploading installation tarballs to |onprem|.
28+
29+
Prerequisites and Considerations
30+
--------------------------------
31+
32+
:ref:`deploy-om-container`. The following procedure shows you how to
33+
update your |onprem| |k8s| |k8s-obj| to enable Local Mode.
34+
35+
Procedure
36+
---------
37+
38+
.. include:: /includes/steps/deploy-k8s-opsmgr-local-mode.rst

source/tutorial/deploy-om-container.txt

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,7 @@ You can deploy |onprem| in a container with the |k8s-op-short|.
2121
Prerequisites and Considerations
2222
--------------------------------
2323

24-
Before you deploy an |onprem| resource, make sure you :ref:`plan for
25-
your Ops Manager resource <plan-om-resource>`:
26-
27-
- Complete the :ref:`Prerequisites <om-rsrc-prereqs>`
28-
- Read the :ref:`Considerations <om-rsrc-considerations>`.
24+
.. include:: /includes/deploy-om-prereqs.rst
2925

3026
Procedure
3127
---------

source/tutorial/plan-om-resource.txt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -303,6 +303,15 @@ settings to the |k8s-obj| specification that configures the
303303
- ``spec.``:opsmgrkube:`~spec.externalConnectivity`
304304
- ``spec.externalConnectivity.``:opsmgrkube:`~spec.externalConnectivity.type`
305305

306+
.. _om-local-mode:
307+
308+
Deploying |onprem| in Local Mode
309+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
310+
311+
See :ref:`deploy-om-container-local-mode` to use the |k8s-op-short| to
312+
deploy |onprem| if your environment prevents granting hosts in your
313+
|k8s| cluster access to the internet.
314+
306315
.. _mdb-resource-deployment-locations:
307316

308317
Managing External MongoDB Deployments

0 commit comments

Comments
 (0)