apiVersion: apps/v1
kind: Deployment
metadata:
  name: mongodb

spec:

  selector:
    matchLabels:
      app: mongodb

  template:
    metadata:
      labels:
        app: mongodb

    spec:
      containers:
        - name: mongodb
          image: library/mongo:3.6.5-jessie
          volumeMounts:
            - mountPath: /data/db
              name: mongo-persistent-storage

      volumes:
        - name: mongo-persistent-storage
          persistentVolumeClaim:
            claimName: mongo-pvc

  replicas: 1
