...
MongoDB pods cannot start due to persistent volume mounting error.
\uD83C\uDF31 Solution
Configure MongoDB to use a new Recreate persistent volume claim.
Run command: kubectl edit statefulset mongo -n <onelist namespace>
Change volumeMounts.name to a different value. For example: mongo-persistent-volume-2. Save the change.
MongoDB pods will restart. A new persistent volume will be created and mounted by the new podsOpen MongoDB statefulset deployment yaml.
Set
replicas
to 0. Save and wait for all pods terminates.Go to Storage → Persistent volume claims. Select the persistent volume claim belongs to the failing mogodb deployment and delete it.
Go back to the MongoDB stateful set deployment yaml and change replicas to 1.
The pod should be able to start now.