Error when creating a mongodb replicaset - shows unrecognized option '--smallfiles'
--smallfiles
is not supported in newest mongo (4.2) you can check it in doc, you are not specifying image tag so newest latest
is pull in this case mongo 4.2.
If you set image: mongo:4.0
your configuration should be correct.
Try removing the small file or else please try the block below i have provided.
apiVersion: apps/v1kind: StatefulSetmetadata: labels: app: mongodb-replicaset name: logs-mongodb-replicasetspec: podManagementPolicy: OrderedReady replicas: 3 revisionHistoryLimit: 10 selector: matchLabels: app: mongodb-replicaset serviceName: logs-mongodb-replicaset template: metadata: creationTimestamp: null labels: app: mongodb-replicaset spec: containers: - args: - --config=/data/configdb/mongod.conf - --dbpath=/data/db - --replSet=rs0 - --port=27017 - --bind_ip=0.0.0.0 command: - mongod image: mongo:3.6 imagePullPolicy: IfNotPresent livenessProbe: exec: command: - mongo - --eval - db.adminCommand('ping') failureThreshold: 3 initialDelaySeconds: 30 periodSeconds: 10 successThreshold: 1 timeoutSeconds: 5 name: mongodb-replicaset ports: - containerPort: 27017 name: peer protocol: TCP readinessProbe: exec: command: - mongo - --eval - db.adminCommand('ping') failureThreshold: 3 initialDelaySeconds: 5 periodSeconds: 10 successThreshold: 1 timeoutSeconds: 1 resources: {} terminationMessagePath: /dev/termination-log terminationMessagePolicy: File volumeMounts: - mountPath: /data/db name: datadir - mountPath: /data/configdb name: configdir - mountPath: /work-dir name: workdir