Read-only file system: MongoDB Cluster on Kubernetes using Helm charts

4/4/2018

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?

-- Chinmay Mokashi
docker
kubernetes
kubernetes-helm
mongodb

1 Answer

4/4/2018

Docker exports volumes from filesystem using -v command line option. i.e. -v /var/tmp:/tmp

Can you check if the containers/pods are writing to shared volumes, not to the root filesystem?

-- d0bry
Source: StackOverflow