apiVersion: apps/v1
kind: StatefulSet
metadata:
  name: mongo
spec:
  selector:
    matchLabels:
      app: mongo
  serviceName: "mongo"
  replicas: 1
  template:
    metadata:
      labels:
        app: mongo
    spec:
      containers:
        - name: mongo
          command:
            - mongod
            - "--bind_ip_all"
            - "--replSet"
            - rs0
          resources:
            requests:
              memory: "1G"
              cpu: "300m"
            limits:
              memory: "2G"
              cpu: "1000m"
  volumeClaimTemplates:
    - metadata:
        name: mongo-volume
      spec:
        accessModes:
          - ReadWriteOnce
        resources:
          requests:
            storage: 5Gi
