<p>I am creating the below mongodb statefulset which creates 3 replicas but when I run the code I get the below error and all pods are in CrashLoopBackOff state.</p>

<p>This is the error which I get when I try kubectl create -f </p>

<pre><code>Error parsing command line: unrecognised option '--smallfiles' 
</code></pre>

<pre><code>apiVersion: apps/v1beta1
kind: StatefulSet
metadata:
 name: mongo
 namespace: microservice1
spec:
 serviceName: "mongo"
 replicas: 3
 template:
   metadata:
     labels:
       role: mongo
       environment: test
   spec:
     terminationGracePeriodSeconds: 10
     containers:
       - name: mongo
         image: mongo
         command:
           - mongod
           - "--replSet"
           - rs0
           - "--smallfiles"
           - "--noprealloc"
         ports:
           - containerPort: 27017
         volumeMounts:
           - name: mongo-persistent-storage
             mountPath: /data/db
       - name: mongo-sidecar
         image: cvallance/mongo-k8s-sidecar
         env:
           - name: MONGO_SIDECAR_POD_LABELS
             value: "role=mongo,environment=test"
     volumes:
      - name: mongo-persistent-storage
        flexVolume:
          driver: rook.io/rook
          fsType: ceph
          options:
            fsName: myfs # name of the filesystem specified in the filesystem CRD.
            clusterNamespace: rook # namespace where the Rook cluster is deployed
            clusterName: rook

</code></pre>

<p><code>--smallfiles</code> is not supported in newest mongo (4.2) you can check it in <a href="https://docs.mongodb.com/manual/reference/program/mongod/" rel="noreferrer">doc</a>, you are not specifying image tag so newest <code>latest</code> is pull in this case mongo 4.2. </p>

<p>If you set <code>image: mongo:4.0</code> your configuration should be correct.</p>
