Skip to content

Commit 6ae6259

Browse files
(DOCSP-13517): update local mode tutorial (#466)
* (DOCSP-13517): update local mode tutorial * (DOCSP-13517): troubleshoot build * (DOCSP-13517): tech and copy review feedback
1 parent ac471d6 commit 6ae6259

File tree

2 files changed

+155
-14
lines changed

2 files changed

+155
-14
lines changed

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

Lines changed: 137 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,56 @@ inherit:
55
file: steps-configure-kubectl-namespace.yaml
66
ref: configure-kubectl-namespace
77
---
8-
title: "Copy the highlighted fields of this |onprem| resource."
8+
title: "Delete the |k8s-statefulset| that manages your |onprem| Pods."
99
stepnum: 2
1010
level: 4
11+
ref: delete-sts
12+
content: |
13+
14+
In this tutorial, you update the StatefulSet that manages the |onprem|
15+
Pods in your |k8s| cluster.
16+
17+
You must first delete the |onprem| StatefulSet so that |k8s| can apply
18+
the updates that Local Mode requires.
19+
20+
a. Find the name of your |onprem| StatefulSet:
21+
22+
.. code-block:: sh
23+
24+
kubectl get statefulsets
25+
26+
The entry in the response that matches the
27+
:opsmgrkube:`metadata.name` of your
28+
29+
Your |onprem| StatefulSet is the entry in the response that matches
30+
the :opsmgrkube:`metadata.name` in your |onprem| resource
31+
definition.
32+
33+
.. code-block:: sh
34+
:copyable: false
35+
:emphasize-lines: 3
36+
37+
kubectl get statefulsets -n mongodb
38+
NAME READY AGE
39+
ops-manager-localmode 2/2 2m31s
40+
ops-manager-localmode-db 3/3 4m46s
41+
42+
#. Delete the |onprem| StatefulSet:
43+
44+
.. warning::
45+
46+
Ensure that you include the ``--cascade=false`` flag when you
47+
delete your |onprem| StatefulSet. If you don't include this
48+
flag, |k8s| also deletes your |onprem| Pods.
49+
50+
.. code-block:: sh
51+
52+
kubectl delete statefulset --cascade=false <ops-manager-statefulset>
53+
54+
---
55+
title: "Copy the highlighted fields of this |onprem| resource."
56+
stepnum: 3
57+
level: 4
1158
ref: copy-k8s-example
1259
content: |
1360
@@ -30,7 +77,7 @@ content: |
3077
3178
---
3279
title: "Paste the copied example section into your existing |onprem| resource."
33-
stepnum: 3
80+
stepnum: 4
3481
level: 4
3582
ref: paste-k8s-example
3683
content: |
@@ -39,27 +86,105 @@ content: |
3986
specification into the appropriate location in your resource file.
4087
---
4188
title: "Save your |onprem| config file."
42-
stepnum: 4
89+
stepnum: 5
4390
level: 4
4491
ref: save-object-spec
4592

4693
---
4794
title: "Apply changes to your |onprem| deployment."
48-
stepnum: 5
95+
stepnum: 6
4996
level: 4
5097
ref: apply-changes-om-k8s
5198
content: |
5299
53-
Invoke the following ``kubectl`` command on the filename of the
54-
|onprem| resource definition:
100+
a. Invoke the following ``kubectl`` command on the filename of the
101+
|onprem| resource definition:
55102
56-
.. code-block:: sh
103+
.. code-block:: sh
104+
105+
kubectl apply -f <opsmgr-resource>.yaml
106+
107+
#. |k8s| creates a new |onprem| StatefulSet when you apply the changes
108+
to your |onprem| resource definition. Before proceeding to the next
109+
step, run the following command to ensure that the |onprem| StatefulSet
110+
exists:
111+
112+
.. code-block:: sh
57113
58-
kubectl apply -f <opsmgr-resource>.yaml
114+
kubectl get statefulsets
115+
116+
The new |onprem| StatefulSet should show 0 members ready:
117+
118+
.. code-block:: sh
119+
:copyable: false
120+
:emphasize-lines: 3
121+
122+
kubectl get statefulsets -n mongodb
123+
NAME READY AGE ops-manager-localmode 0/2 2m31s
124+
ops-manager-localmode-db 3/3 4m46s
125+
126+
---
127+
title: "In a rolling fashion, delete your old |onprem| Pods."
128+
stepnum: 7
129+
level: 4
130+
ref: delete-old-om-pods
131+
content: |
132+
133+
a. List the |onprem| Pods in your |k8s| cluster:
134+
135+
.. code-block:: sh
136+
137+
kubectl get pods
138+
139+
#. Delete one |onprem| Pod:
140+
141+
.. code-block:: sh
142+
143+
kubectl delete pod <om-pod-0>
144+
145+
#. |k8s| recreates the |onprem| Pod you deleted. Continue to get the
146+
status of the new Pod until it is ready:
147+
148+
.. code-block:: sh
149+
150+
kubectl get pods
151+
152+
153+
The output looks like the following when the new Pod is
154+
initializing:
155+
156+
.. code-block:: sh
157+
:copyable: false
158+
:emphasize-lines: 3
159+
160+
NAME READY STATUS RESTARTS AGE
161+
mongodb-enterprise-operator-5648d4c86-k5brh 1/1 Running 0 5m24s
162+
ops-manager-localmode-0 0/1 Running 0 0m55s
163+
ops-manager-localmode-1 1/1 Running 0 5m45s
164+
ops-manager-localmode-db-0 1/1 Running 0 5m19s
165+
ops-manager-localmode-db-1 1/1 Running 0 4m54s
166+
ops-manager-localmode-db-2 1/1 Running 0 4m12s
167+
168+
The output looks like the following when the new Pod is ready:
169+
170+
.. code-block:: sh
171+
:copyable: false
172+
:emphasize-lines: 4
173+
174+
NAME READY STATUS RESTARTS AGE
175+
mongodb-enterprise-operator-5648d4c86-k5brh 1/1 Running 0 5m24s
176+
ops-manager-localmode-0 1/1 Running 0 3m55s
177+
ops-manager-localmode-1 1/1 Running 0 5m45s
178+
ops-manager-localmode-db-0 1/1 Running 0 5m19s
179+
ops-manager-localmode-db-1 1/1 Running 0 4m54s
180+
ops-manager-localmode-db-2 1/1 Running 0 4m12s
181+
182+
#. Repeat Steps **b** and **c** until you've deleted all of your
183+
|onprem| Pods and confirmed that all of the new Pods are ready.
59184
60185
---
61186
title: "Track the status of your |onprem| instance."
62-
stepnum: 6
187+
stepnum: 8
63188
level: 4
64189
ref: track-k8s-instance
65190
content: |
@@ -90,7 +215,7 @@ content: |
90215
title: "Download the MongoDB installation archive to your local machine."
91216
level: 4
92217
ref: download-mdb-archive
93-
stepnum: 7
218+
stepnum: 9
94219
content: |
95220
96221
The installers that you download depend on the environment to which
@@ -152,7 +277,7 @@ content: |
152277
title: "Copy the MongoDB installation archive to the |onprem| Persistent Volume for each |onprem| :opsmgrkube:`replica <spec.replicas>` you deployed."
153278
level: 4
154279
ref: copy-mdb-archive
155-
stepnum: 8
280+
stepnum: 10
156281
content: |
157282
158283
The commands that you use depend on the environment to which you
@@ -258,7 +383,7 @@ content: |
258383
title: "Deploy a MongoDB Database Resource."
259384
level: 4
260385
ref: deploy-mdb-resource
261-
stepnum: 9
386+
stepnum: 11
262387
content: |
263388
264389
a. If you have not done so already, complete the following

source/tutorial/deploy-om-container-local-mode.txt

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,11 @@ Configure an |onprem| Resource to use Local Mode
1616

1717
.. include:: /includes/styles/corrections.rst
1818

19+
.. important::
20+
21+
Configuring |onprem| to use Local Mode in |k8s| is not recommended.
22+
Consider :ref:`configuring Ops Manager to use Remote Mode <deploy-om-container-remote-mode>` instead.
23+
1924
In a default configuration, the {+mdbagent+}\s and Backup Daemons
2025
access MongoDB installation archives over the Internet from |company|
2126

@@ -54,8 +59,19 @@ Database Tools <database-tools>`.
5459
Prerequisites
5560
-------------
5661

57-
:ref:`deploy-om-container`. The following procedure shows you how to
58-
update your |onprem| |k8s| |k8s-obj| to enable Local Mode.
62+
- :ref:`deploy-om-container`. The following procedure shows you how to
63+
update your |onprem| |k8s| |k8s-obj| to enable Local Mode.
64+
65+
- To avoid downtime when you enable Local Mode, ensure that you set
66+
:opsmgrkube:`spec.replicas` to a value greater than ``1`` in your
67+
|onprem| resource definition.
68+
69+
If you updated your |onprem| resource definition to make |onprem|
70+
highly available, apply your changes before you begin this tutorial:
71+
72+
.. code-block:: sh
73+
74+
kubectl apply -f <opsmgr-resource>.yaml -n <namespace>
5975

6076
Procedure
6177
---------

0 commit comments

Comments
 (0)