apiVersion: apps/v1
kind: StatefulSet
metadata:
  name: mongo-db-sts
spec:
  selector:
    matchLabels:
      app: mongodb
  serviceName: "mongo-svc"
  replicas: 1
  template:
    metadata:
      labels:
        app: mongodb
    spec:
      containers:
      - name: mongodb
        image: mongo:3.6
        args:
        - --smallfiles
        - --logpath=/dev/null
        volumeMounts:
        - mountPath: "/data/db"
          name: mongodb-data
  volumeClaimTemplates:
  - metadata:
      name: mongodb-data
    spec:
      accessModes:
      - ReadWriteOnce
      resources:
        requests:
          storage: 5Gi
      storageClassName: do-block-storage