I launched a MongoDB replica set on Kubernetes (GKE as well as kubeadm). I faced no problems with the pods accessing the storage. However, when I used Helm to deploy the same, I face this problem. When I run this command- (
kubectl describe po mongodb-shard1-0 --namespace=kube-system )
(Here mongodb-shard1-0 is the first and only pod (of the desired three) which was created) I get the error- Events
Error: failed to start container "mongodb-shard1-container": Error response from daemon: error while creating mount source path '/mongo/data': mkdir /mongo: read-only file system
I noticed one major difference between the two ways of creating MongoDB cluster (without Helm, and with Helm)- when using Helm, I had to create a service account and install the Helm chart using that service account. Without Helm, I did not need that.
I used different mongo docker images, I faced the same error every time.
Can anybody help why I am facing this issue?