Skip to content

Commit c47f899

Browse files
(DOCSP-7311): Create "Deploy Ops Manager in a Container" procedure (#127)
* Docsp 7313: add k8s operator ops manager resource deployment settings (#114) * (DOCSP-7313): first draft of OM container properties * (DOCSP-7313): pushing setting file updates * (DOCSP-7313): adding om object settings using new directive * (DOCSP-7313): reverting replica set setting program changes * (DOCSP-7313): cleaning up files changed when experimenting with settings issue * (DOCSP-7313): typo fix * Apply suggestions from copy review Co-Authored-By: Melissa Mahoney <[email protected]> * (DOCSP-7313): address copy review comments * (DOCSP-7313): more copy review feedback * (DOCSP-7313): tech review feedback * (DOCSP-7313): more copy review edits * (DOCSP-7311): Create "Deploy Ops Manager in a Container" procedure
1 parent 85ed15e commit c47f899

24 files changed

+718
-57
lines changed
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
:noprevnext:
2+
3+
==================================================
4+
Configure the |k8s-op-short| for MongoDB Resources
5+
==================================================
6+
7+
.. default-domain:: mongodb
8+
9+
.. contents:: On this page
10+
:local:
11+
:backlinks: none
12+
:depth: 1
13+
:class: singlecol
14+
15+
.. include:: /includes/toc/dfn-list-configure-k8s-operator-for-mdb-resources.rst
16+
17+
.. include:: /includes/toc/configure-k8s-operator-for-mdb-resources.rst
18+
19+
.. class:: hidden
20+
21+
.. toctree::
22+
:titlesonly:
23+
24+
/tutorial/create-operator-credentials
25+
/tutorial/create-project-using-configmap
26+
/tutorial/create-x509-client-certs

source/deploy.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ Deploy Resources
2323
.. toctree::
2424
:titlesonly:
2525

26+
/tutorial/deploy-om-container
2627
/tutorial/deploy-standalone
2728
/tutorial/deploy-replica-set
2829
/tutorial/deploy-sharded-cluster
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
.. admonition:: Alpha Release of |onprem| Resource
2+
:class: important
3+
4+
Don't use the |onprem| resource in
5+
production environments.
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
.. admonition:: Use namespace and name of admin user secret
2+
:class: note
3+
4+
This value must match the ``metadata.name`` specified in your admin
5+
user |k8s| secret.
6+
7+
If the secret is in a different |k8s-ns|, set this value to the
8+
``namespace`` and ``name`` of the secret using this format:
9+
``<namespace>/<name>``
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
.. warning::
2+
3+
Grant your containers permission to write to your |k8s-pv|.
4+
The |k8s-op-short| sets ``fsGroup = 2000`` in
5+
:k8sdocs:`securityContext </tasks/configure-pod-container/security-context/>`
6+
This makes |k8s|
7+
:k8sdocs:`try to fix write permissions </tasks/configure-pod-container/security-context/#discussion>`
8+
for the |k8s-pv|. If redeploying the resource does not fix
9+
issues with your |k8s-pvs|, contact MongoDB support.

source/includes/k8s/k8s-persistent-volumes.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66
This makes |k8s|
77
`try to fix write permissions <https://kubernetes.io/docs/tasks/configure-pod-container/security-context/#discussion>`__
88
for the |k8s-pv|. If redeploying the deployment item does not fix
9-
issues with your |k8s-pvs|, contact MongoDB support.
9+
issues with your |k8s-pvs|, contact `MongoDB Support
10+
<https://support.mongodb.com/welcome>`__.
1011

1112
.. note::
1213

source/includes/list-table-k8s-kubectl-install-options.rst

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,3 +129,74 @@
129129
env:
130130
- name: MANAGED_SECURITY_CONTEXT
131131
value: 'true'
132+
133+
* - ``OPS_MANAGER_IMAGE_REPOSITORY``
134+
- |url| of the repository from which the image for an :doc:`Ops
135+
Manager resource </tutorial/deploy-om-container>` is downloaded.
136+
137+
Default value is:
138+
``quay.io/mongodb/mongodb-enterprise-ops-manager``
139+
140+
.. code-block:: yaml
141+
142+
spec.template.spec.containers.name.env.name:
143+
OPS_MANAGER_IMAGE_REPOSITORY
144+
spec.template.spec.containers.name.env.value:
145+
quay.io/mongodb/mongodb-enterprise-ops-manager
146+
147+
.. example::
148+
149+
.. code-block:: yaml
150+
:linenos:
151+
:emphasize-lines: 10-13
152+
153+
spec:
154+
template:
155+
spec:
156+
serviceAccountName: mongodb-enterprise-operator
157+
containers:
158+
- name: mongodb-enterprise-operator
159+
image: <operatorVersionUrl>
160+
imagePullPolicy: <policyChoice>
161+
env:
162+
- name: OPS_MANAGER_IMAGE_REPOSITORY
163+
value: quay.io/mongodb/mongodb-enterprise-ops-manager
164+
- name: OPS_MANAGER_IMAGE_PULL_POLICY
165+
value: Always
166+
167+
* - ``OPS_MANAGER_IMAGE_PULL_POLICY``
168+
- :k8sdocs:`Pull policy
169+
</concepts/configuration/overview/#container-images>` for the
170+
image deployed to an :doc:`Ops Manager resource
171+
</tutorial/deploy-om-container>`.
172+
173+
Accepted values are: ``Always``, ``IfNotPresent``, ``Never``
174+
175+
Default value is: ``Always``
176+
177+
.. code-block:: yaml
178+
179+
spec.template.spec.containers.name.env.name:
180+
OPS_MANAGER_IMAGE_PULL_POLICY
181+
spec.template.spec.containers.name.env.value:
182+
<policy>
183+
184+
.. example::
185+
186+
.. code-block:: yaml
187+
:linenos:
188+
:emphasize-lines: 10-13
189+
190+
spec:
191+
template:
192+
spec:
193+
serviceAccountName: mongodb-enterprise-operator
194+
containers:
195+
- name: mongodb-enterprise-operator
196+
image: <operatorVersionUrl>
197+
imagePullPolicy: <policyChoice>
198+
env:
199+
- name: OPS_MANAGER_IMAGE_REPOSITORY
200+
value: quay.io/mongodb/mongodb-enterprise-ops-manager
201+
- name: OPS_MANAGER_IMAGE_PULL_POLICY
202+
value: Always
Lines changed: 234 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,234 @@
1+
---
2+
title: "Copy the following example |onprem| |k8s| |k8s-obj|."
3+
stepnum: 1
4+
level: 4
5+
ref: copy-k8s-example
6+
content: |
7+
8+
Change the highlighted settings to match your desired
9+
|onprem| configuration.
10+
11+
.. literalinclude:: /reference/k8s/example-opsmgr-minimal.yaml
12+
:language: yaml
13+
:emphasize-lines: 5-10,12-13
14+
15+
---
16+
title: "Open your preferred text editor and paste the |k8s-obj| specification into a new text file."
17+
stepnum: 2
18+
level: 4
19+
ref: paste-k8s-example
20+
---
21+
title: "Configure the settings highlighted in the prior example."
22+
stepnum: 3
23+
level: 4
24+
ref: change-k8s-values
25+
content: |
26+
27+
.. list-table::
28+
:widths: 20 20 40 20
29+
:header-rows: 1
30+
31+
* - Key
32+
- Type
33+
- Description
34+
- Example
35+
36+
* - :opsmgrkube:`metadata.name`
37+
- string
38+
- Name for this |k8s| |onprem| |k8s-obj|.
39+
40+
.. seealso::
41+
42+
- :opsmgrkube:`metadata.name`
43+
- |k8s| documentation on :k8sdocs:`names </concepts/overview/working-with-objects/names/>`.
44+
45+
- ``om``
46+
47+
* - :opsmgrkube:`spec.version`
48+
- string
49+
- Version of |onprem| to be installed.
50+
51+
The format should be :manual:`X.Y.Z </reference/versioning>`.
52+
To view available |onprem| versions, view the
53+
`container registry <https://quay.io/repository/mongodb/mongodb-enterprise-ops-manager?tag=latest&tab=tags>`__.
54+
- ``4.2.0``
55+
56+
* - :opsmgrkube:`spec.adminCredentials`
57+
- string
58+
- Name of the |k8s-secret| you :ref:`created <om-rsrc-prereqs>`
59+
for the |onprem| admin user.
60+
61+
.. note::
62+
63+
Configure the secret to use the same |k8s-ns| as the |onprem|
64+
resource.
65+
66+
- ``om-admin-secret``
67+
68+
* - | ``spec``
69+
| ``.applicationDatabase``
70+
| ``.``:setting:`~spec.members`
71+
- integer
72+
- Number of members of the :ref:`mms-application-database`
73+
replica set.
74+
- ``3``
75+
76+
* - | ``spec``
77+
| ``.applicationDatabase``
78+
| ``.``:setting:`~spec.version`
79+
- string
80+
- Version of MongoDB that the :ref:`mms-application-database`
81+
should run.
82+
83+
The format should be ``X.Y.Z`` for the Community edition and
84+
``X.Y.Z-ent`` for the :product:`Enterprise edition
85+
</mongodb-enterprise-advanced>`.
86+
87+
To learn more about MongoDB versioning, see see
88+
:ref:`release-version-numbers` in the MongoDB Manual.
89+
- ``4.0.7``
90+
91+
* - | ``spec``
92+
| ``.applicationDatabase``
93+
| ``.``:setting:`~spec.persistent`
94+
- boolean
95+
- *Optional.*
96+
97+
Flag indicating if this |k8s-mdbrsc| should use |k8s-pvs| for
98+
storage. Persistent volumes are not deleted when the
99+
|k8s-mdbrsc| is stopped or restarted.
100+
101+
If this value is ``true``, then
102+
``spec.applicationDatabase.podSpec.persistence.``
103+
:setting:`~spec.podSpec.persistence.single`
104+
is set to its default value of ``16G``.
105+
106+
To change your |k8s-pvcs| configuration, configure the
107+
following collections to meet your deployment requirements:
108+
109+
- If you want one |k8s-pv| for each |k8s-pod|, configure the
110+
``spec.applicationDatabase.``
111+
:setting:`~spec.podSpec.persistence.single` collection.
112+
113+
- If you want separate |k8s-pvs| for data, journals, and
114+
logs for each |k8s-pod|, configure the following
115+
collections:
116+
117+
- | ``spec.applicationDatabase``
118+
| ``.podSpec.persistence.multiple.``
119+
| :setting:`~spec.podSpec.persistence.multiple.data`
120+
- | ``spec.applicationDatabase``
121+
| ``.podSpec.persistence.multiple.``
122+
| :setting:`~spec.podSpec.persistence.multiple.journal`
123+
- | ``spec.applicationDatabase``
124+
| ``.podSpec.persistence.multiple.``
125+
| :setting:`~spec.podSpec.persistence.multiple.logs`
126+
127+
.. include:: /includes/k8s/k8s-persistent-volumes-om.rst
128+
129+
- ``true``
130+
131+
---
132+
title: "(Optional) Configure any additional settings for an |onprem| deployment."
133+
stepnum: 4
134+
level: 4
135+
ref: add-k8s-values
136+
content: |
137+
138+
You can add any of the following optional settings to the
139+
|k8s-obj| specification file for an |onprem| deployment:
140+
141+
- :opsmgrkube:`spec.clusterName`
142+
- :opsmgrkube:`spec.configuration`
143+
- ``spec.applicationDatabase.``:setting:`~spec.logLevel`
144+
- ``spec.applicationDatabase.``:setting:`~spec.featureCompatibilityVersion`
145+
- ``spec.applicationDatabase.podSpec.``:setting:`~spec.podSpec.cpu`
146+
- ``spec.applicationDatabase.podSpec.``:setting:`~spec.podSpec.cpuRequests`
147+
- ``spec.applicationDatabase.podSpec.``:setting:`~spec.podSpec.memory`
148+
- ``spec.applicationDatabase.podSpec.``:setting:`~spec.podSpec.memoryRequests`
149+
- ``spec.applicationDatabase.podSpec.persistence.``:setting:`~spec.podSpec.persistence.single`
150+
- ``spec.applicationDatabase.podSpec.persistence.multiple.``:setting:`~spec.podSpec.persistence.multiple.data`
151+
- ``spec.applicationDatabase.podSpec.persistence.multiple.``:setting:`~spec.podSpec.persistence.multiple.journal`
152+
- ``spec.applicationDatabase.podSpec.persistence.multiple.``:setting:`~spec.podSpec.persistence.multiple.logs`
153+
- ``spec.applicationDatabase.podSpec.``:setting:`~spec.podSpec.podAffinity`
154+
- ``spec.applicationDatabase.podSpec.``:setting:`~spec.podSpec.podAntiAffinityTopologyKey`
155+
- ``spec.applicationDatabase.podSpec.``:setting:`~spec.podSpec.nodeAffinity`
156+
157+
---
158+
title: "Save this file with a ``.yaml`` file extension."
159+
stepnum: 5
160+
level: 4
161+
ref: save-object-spec
162+
163+
---
164+
title: "Create your |onprem| instance."
165+
stepnum: 6
166+
level: 4
167+
ref: start-k8s-instance
168+
content: |
169+
170+
Invoke the following ``kubectl`` command on the filename of the
171+
|onprem| resource definition:
172+
173+
.. code-block:: sh
174+
175+
kubectl apply -f <opsmgr-resource>.yaml
176+
177+
---
178+
title: "Track the status of your |onprem| instance."
179+
stepnum: 7
180+
level: 4
181+
ref: track-k8s-instance
182+
content: |
183+
184+
To check the status of your |onprem| resource, invoke the following
185+
command:
186+
187+
.. code-block:: sh
188+
189+
kubectl get om -n <namespace> -o yaml -w
190+
191+
The ``-w`` flag means "watch". With the "watch" flag set, the output
192+
refreshes immediately when something changes.
193+
194+
If the deployment fails, see :doc:`/reference/troubleshooting`.
195+
196+
---
197+
title: "Access your |onprem| instance from a browser."
198+
stepnum: 8
199+
level: 4
200+
ref: access-opsmgr-instance
201+
content: |
202+
203+
a. After the resource deploys successfully, find the external port to
204+
your |onprem| instance.
205+
206+
Invoke the following ``kubectl`` command on ``<metadata.name>-svc-external``:
207+
``metadata.name`` :
208+
209+
.. code-block:: sh
210+
211+
kubectl get svc <metadata.name>-svc-external -n <namespace>
212+
213+
The command returns the external port in the ``PORT(S)`` column. In
214+
the following example output, the external port is ``30036``:
215+
216+
.. code-block:: sh
217+
:copyable: false
218+
219+
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
220+
<metadata.name>-svc-external NodePort 100.66.92.110 <none> 8080:30036/TCP 1d
221+
222+
#. Set your firewall rules to allow access from the Internet to the
223+
external port on the host.
224+
225+
#. Open a browser window and navigate to the |onprem| application
226+
using the |fqdn| and port number.
227+
228+
.. code-block:: sh
229+
230+
http://ops.example.com:30036
231+
232+
#. Log in to |onprem| using the :ref:`admin user credentials
233+
<om-rsrc-prereqs>`.
234+
...
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
file: /tutorial/create-operator-credentials
2+
description: |
3+
Create a |k8s-secret| so the |k8s-op-short| can create and update
4+
|k8s-objs| in your |com| Project.
5+
---
6+
file: /tutorial/create-project-using-configmap
7+
description: |
8+
Create a |k8s-configmap| to link the |k8s-op-short| to your |com|
9+
Project.
10+
---
11+
file: /tutorial/create-x509-client-certs
12+
description:
13+
Create an X.509 certificate to connect to an X.509-enabled
14+
MongoDB deployment.
15+
...

0 commit comments

Comments
 (0)