apiVersion: apps/v1
kind: Deployment
metadata:
  name: database
  namespace: database
spec:
  selector:
    matchLabels:
      app: database
  replicas: 1
  template:
    metadata:
      labels:
        app: database
    spec:
      containers:
        - name: mongodb
          image: mongo:latest
          ports:
            - containerPort: 27017
          volumeMounts:
            - name: mongodb-persistent-storage
              mountPath: /data/db
      volumes:
        - name: mongodb-persistent-storage
          gcePersistentDisk:
            pdName: mongodb-disk
            fsType: ext4
