Skip to content

Commit 6dfdb80

Browse files
Anthony Sansonejwilliams-mongo
authored andcommitted
(DOCSP-4947): Add StatefulSet troubleshooting entry.
1 parent 1c17992 commit 6dfdb80

File tree

1 file changed

+76
-9
lines changed

1 file changed

+76
-9
lines changed

source/reference/troubleshooting.txt

Lines changed: 76 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ To find the status of a MongoDB Resource (replica set, sharded cluster, or stand
2323

2424
kubectl get mdb <resourcename> -n <namespace> -o yaml -w
2525

26-
The command's response describes the status of the resource using the
26+
The command's response describes the status of the resource using the
2727
following key-value pairs:
2828

2929
.. list-table::
@@ -145,7 +145,7 @@ invoke this command:
145145

146146
kubectl logs myrs-0 -n <metadata.namespace>
147147

148-
This returns the :ref:`Automation Agent Log <agent-logs>` for this
148+
This returns the :ref:`Automation Agent Log <agent-logs>` for this
149149
replica set.
150150

151151
View All |k8s-mdbrsc| Specifications
@@ -195,6 +195,73 @@ To view all |k8s-mdbrsc| specifications in the provided
195195
project: my-om-config
196196
version: 4.0.0-ent
197197

198+
.. _k8s-rollback-failure:
199+
200+
Restore StatefulSet that Failed to Deploy
201+
-----------------------------------------
202+
203+
A StatefulSet |k8s-pod| may hang with a status of ``Pending`` if it
204+
encounters an error during deployment.
205+
206+
``Pending`` |k8s-pods| do not automatically terminate, even if you
207+
make *and apply* configuration changes to resolve the error.
208+
209+
To return the StatefulSet to a healthy state, apply the configuration
210+
changes to the MongoDB resource in the ``Pending`` state, then delete
211+
those pods.
212+
213+
.. example::
214+
215+
A host system has a number of running |k8s-pods|:
216+
217+
.. code-block:: sh
218+
:copyable: false
219+
:emphasize-lines: 5
220+
221+
kubectl get pods
222+
223+
my-replica-set-0 1/1 Running 2 2h
224+
my-replica-set-1 1/1 Running 2 2h
225+
my-replica-set-2 0/1 Pending 0 2h
226+
227+
``my-replica-set-2`` is stuck in the ``Pending`` stage. To gather
228+
more data on the error, run the following:
229+
230+
.. code-block:: sh
231+
:copyable: false
232+
:emphasize-lines: 1,5
233+
234+
kubectl describe pod my-replica-set-2
235+
236+
<describe output omitted>
237+
238+
Warning FailedScheduling 15s (x3691 over 3h) default-scheduler 0/3 nodes are available: 1 node(s) had taints that the pod didn't tolerate, 2 Insufficient memory.
239+
240+
The output indicates an error in memory allocation.
241+
242+
Updating the memory allocations in the MongoDB resource is
243+
insufficient, as the pod does not terminate automatically after
244+
applying configuration updates.
245+
246+
To remedy this issue, update the configuration, apply the
247+
configuration, then delete the hung pod:
248+
249+
.. code-block:: sh
250+
251+
vi <my-replica-set>.yaml
252+
253+
kubectl apply -f <my-replica-set>.yaml
254+
255+
kubectl delete pod my-replica-set-2
256+
257+
Once this hung pod is deleted, the other pods restart with your new
258+
configuration as part of rolling upgrade of the Statefulset.
259+
260+
.. note::
261+
262+
To learn more about this issue, see
263+
`Kubernetes Issue 67250 <https://github.com/kubernetes/kubernetes/issues/67250>`__.
264+
198265
.. _remove-k8s-resource:
199266

200267
Remove a |k8s-mdbrsc|
@@ -222,22 +289,22 @@ To remove any instance that |k8s| deployed, you must use |k8s|.
222289

223290
kubectl delete mdb --all -n <metadata.namespace>
224291

225-
.. _remove-k8s-operator:
292+
.. _remove-k8s-operator:
226293

227294
Remove the |k8s-op-short|
228295
-------------------------
229296

230-
To remove the |k8s-op-short|:
297+
To remove the |k8s-op-short|:
231298

232-
1. :ref:`Remove all Kubernetes resources <remove-k8s-resource>`:
299+
1. :ref:`Remove all Kubernetes resources <remove-k8s-resource>`:
233300

234-
.. code-block:: shell
301+
.. code-block:: shell
235302

236-
kubectl delete mdb --all -n <metadata.namespace>
303+
kubectl delete mdb --all -n <metadata.namespace>
237304

238-
2. Remove the |k8s-op-short|:
305+
2. Remove the |k8s-op-short|:
239306

240-
.. code-block:: shell
307+
.. code-block:: shell
241308

242309
kubectl delete deployment mongodb-enterprise-operator -n <metadata.namespace>
243310

0 commit comments

Comments
 (0)