# ---
# apiVersion: apps/v1
# kind: Deployment
# metadata:
#   name: mongo
#   labels:
#     app: reddit
#     component: mongo
#     comment-db: "true"
#     post-db: "true"
# spec:
#   replicas: 1
#   selector:
#     matchLabels:
#       app: reddit
#       component: mongo
#   template:
#     metadata:
#       name: mongo
#       labels:
#         app: reddit
#         component: mongo
#         comment-db: "true"
#         post-db: "true"
#     spec:
#       containers:
#       - image: mongo:3.2
#         name: mongo
#         volumeMounts:
#         - name: mongo-persistent-storage
#           mountPath: /data/db
#       volumes:
#       - name: mongo-persistent-storage
#         emptyDir: {}
---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: mongo-gce-pd-storage
  labels:
    app: reddit
    component: mongo
    post-db: "true"
    comment-db: "true"
spec:
  replicas: 1
  selector:
    matchLabels:
      app: reddit
      component: mongo
  template:
    metadata:
      name: mongo
      labels:
        app: reddit
        component: mongo
        post-db: "true"
        comment-db: "true"
    spec:
      containers:
      - image: mongo:3.2
        name: mongo
        volumeMounts:
        - name: mongo-persistent-storage
          mountPath: /data/db
      volumes:
      - name: mongo-persistent-storage
        persistentVolumeClaim:
          claimName:  mongo-pvc
