@@ -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 ."
99stepnum : 2
1010level : 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
1158ref : copy-k8s-example
1259content : |
1360
@@ -30,7 +77,7 @@ content: |
3077
3178 ---
3279title : " Paste the copied example section into your existing |onprem| resource."
33- stepnum : 3
80+ stepnum : 4
3481level : 4
3582ref : paste-k8s-example
3683content : |
@@ -39,27 +86,105 @@ content: |
3986 specification into the appropriate location in your resource file.
4087 ---
4188title : " Save your |onprem| config file."
42- stepnum : 4
89+ stepnum : 5
4390level : 4
4491ref : save-object-spec
4592
4693---
4794title : " Apply changes to your |onprem| deployment."
48- stepnum : 5
95+ stepnum : 6
4996level : 4
5097ref : apply-changes-om-k8s
5198content : |
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 ---
61186title : " Track the status of your |onprem| instance."
62- stepnum : 6
187+ stepnum : 8
63188level : 4
64189ref : track-k8s-instance
65190content : |
@@ -90,7 +215,7 @@ content: |
90215title : " Download the MongoDB installation archive to your local machine."
91216level : 4
92217ref : download-mdb-archive
93- stepnum : 7
218+ stepnum : 9
94219content : |
95220
96221 The installers that you download depend on the environment to which
@@ -152,7 +277,7 @@ content: |
152277title : " Copy the MongoDB installation archive to the |onprem| Persistent Volume for each |onprem| :opsmgrkube:`replica <spec.replicas>` you deployed."
153278level : 4
154279ref : copy-mdb-archive
155- stepnum : 8
280+ stepnum : 10
156281content : |
157282
158283 The commands that you use depend on the environment to which you
@@ -258,7 +383,7 @@ content: |
258383title : " Deploy a MongoDB Database Resource."
259384level : 4
260385ref : deploy-mdb-resource
261- stepnum : 9
386+ stepnum : 11
262387content : |
263388
264389 a. If you have not done so already, complete the following
0 commit comments