apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  labels:
    app: fdp
    tier: mongo
  name: mongo-claim0
  namespace: f2ds
spec:
  storageClassName: csi-cinder-high-speed             
  accessModes:
    - ReadWriteOnce
  resources:
    requests:
      storage: 2Gi

---

apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    app: fdp
    tier: mongo
  name: mongo
  namespace: f2ds
spec:
  replicas: 1
  selector:
    matchLabels:
      app: fdp
      tier: mongo
  template:
    metadata:
      annotations:
      labels:
        app: fdp
        tier: mongo
    spec:
      containers:
      - name: mongo
        image: mongo:4.0.12
        env:
        - name: MONGO_INITDB_ROOT_USERNAME
          value: admin
        - name: MONGO_INITDB_ROOT_PASSWORD
          value: adminadmin
        ports:
          - containerPort: 27017
        volumeMounts:
          - mountPath: /data/db
            name: mongo-claim0
      restartPolicy: Always
      volumes:
        - name: mongo-claim0
          persistentVolumeClaim:
            claimName: mongo-claim0
