--- # Version 2021.9.6.001
apiVersion: apps/v1
kind: Deployment
metadata:
  name: mongo-deploy
  labels:
    app: mongo
spec:
  replicas: 1
  selector:
    matchLabels:
      app: mongo
  template:
    metadata:
      labels:
        app: mongo
    spec:
      terminationGracePeriodSeconds: 1
      containers:
      - name: mongo
        image: mongo
        imagePullPolicy: Always
        ports:
        - containerPort: 27017
        env:
        - name: MONGO_INITDB_ROOT_USERNAME
          value: "root"
        - name: MONGO_INITDB_ROOT_PASSWORD
          value: "example"
        volumeMounts:
        - name: mongo-db
          mountPath: /data/db
        - name: mongo-configdb
          mountPath: /data/configdb
        resources:
          requests:
            memory: "64Mi"
            cpu: "250m"
          limits:
            memory: "128Mi"
            cpu: "500m"
      volumes:
      - name: mongo-db
        persistentVolumeClaim:
          claimName: mongo-db-claim
      - name: mongo-configdb
        persistentVolumeClaim:
          claimName: mongo-configdb-claim
