apiVersion: apps/v1
kind: Deployment
metadata:
    name: mongodb-deploymnet
spec:
    replicas: 1
    selector:
        matchLabels:
            component: mongodb
    template:
        metadata:
            labels:
                component: mongodb
        spec:
            volumes:
              - name: mongodb-storage
                persistentVolumeClaim:
                    claimName: database-persistent-volume-claim
            containers:
                - name: mongodb
                  image: mongo:4.0.10
                  ports:
                    - containerPort: 27017
                  volumeMounts:
                    - name: mongodb-storage
                      mountPath: /data/db