apiVersion : apps/v1
kind : Deployment
metadata :
 name : mongodb
spec :
 replicas : 1
 selector :
    matchLabels :
      myApp : mongodb
 template :
   metadata :
     labels :
        myApp : mongodb
   spec :
    containers :
    - name : mongodb
      image : mongo:3.6.5-jessie
      # volume stored outside of pod
      volumeMounts :
        - name : mongo-persistant-storage
          mountPath : /data/db # Data store path for mongodb
    volumes :
      - name : mongo-persistant-storage
        # Pointer to the configuration of how we want to implement mount
        persistentVolumeClaim : 
          claimName : mongo-pvc