apiVersion: apps/v1 # for versions before 1.9.0 use apps/v1beta2
kind: Deployment
metadata:
  name: mongo-deployment
  labels:
    app: reddit
    component: mongo
    post-db: "true"
    comment-db: "true"
spec:
  selector:
    matchLabels:
      app: reddit
      component: mongo
  replicas: 1
  template:
    metadata:
      labels:
        app: reddit
        component: mongo
        post-db: "true"
        comment-db: "true"
    spec:
      containers:
      - name: mongo
        image: mongo:latest
        volumeMounts:
        - name: mongo-gce-pd-storage
          mountPath: /data/db
        resources:
          requests:
            cpu: 100m
            memory: 100Mi
        ports:
        - containerPort: 27017
      volumes:
      - name: mongo-gce-pd-storage
        persistentVolumeClaim:
          claimName: mongo-pvc-dynamic
