apiVersion: apps/v1
kind: Deployment
metadata:
  name: mongodb
  namespace: spoon
spec:
  selector:
    matchLabels:
      app: mongodb
  replicas: 1
  template:
    metadata:
      labels:
        app: mongodb
    spec:
      containers:
        - name: mongodb
          image: mongo:4.4.3-bionic
          imagePullPolicy: "IfNotPresent"
          ports:
            - containerPort: 27017
          envFrom:
            - configMapRef:
                name: mongodb-config
          volumeMounts:
            - mountPath: /data/db
              name: mongodb
          resources:
            requests:
              memory: "100Mi"
              cpu: "100m"
            limits:
              memory: "500Mi"
              cpu: "1"
      volumes:
        - name: mongodb
          persistentVolumeClaim:
            claimName: mongodb-pv-claim