---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: mongo
spec:
  selector:
    matchLabels:
      app: mongo
  replicas: 1
  strategy:
    type: Recreate
  template:
    metadata:
      labels:
        app: mongo
    spec:
      containers:
        - name: master
          image: mongo:3.4.21-xenial
          imagePullPolicy: Always
          resources:
            requests:
              cpu: 10m
              memory: 25Mi
            limits:
              cpu: 1
              memory: 1000Mi
          ports:
            - containerPort: 27017
          envFrom:
            - secretRef:
                name: mongo
          volumeMounts:
            - mountPath: /data/db
              name: mongo-data
      volumes:
        - name: mongo-data
          persistentVolumeClaim:
            claimName: mongo-pvc

