- Deploy Mongodb Application
- Create PersistentVolumeClaim
- Assign PersistentVolumeClaim to Mongodb Application
- Verify that data gets stored in Persistent Storage
Refer Getting Started tutorial
setenforce 0
oc new-app --name mongo -l app=db --docker-image=centos/mongodb-36-centos7 -e MONGODB_ADMIN_PASSWORD=secret
oc get pods
oc describe pod <POD_NAME>
oc set volume dc/mongo --add --name=<PVC_NAME> -t pvc --claim-size=10Gi --overwrite --claim-mode="ReadWriteMany"
Example: oc set volume dc/mongo --add --name=mongo-volume-1 -t pvc --claim-size=10Gi --overwrite --claim-mode="ReadWriteMany"
oc get pvc
oc get pv
oc describe pod <POD_NAME>
oc describe pv <PV_NAME>
Go to PV location
ls