apiVersion: v1
kind: ReplicationController
metadata:
  labels:
    name: mern-k8s-mongo
  name: mongo-controller
spec:
  replicas: 1
  template:
    metadata:
      labels:
        name: mern-k8s-mongo
    spec:
      containers:
        - image: mongo
          name: mern-k8s-mongo
          ports:
            - name: mern-k8s-mongo
              containerPort: 27017
              hostPort: 27017
          volumeMounts:
            - name: mongo-persistent-storage
              mountPath: /data/db
      volumes:
        - name: mongo-persistent-storage
          gcePersistentDisk:
            pdName: mongo-disk
            fsType: ext4
