# Validating OpenShift Container Platform deployment

After the cluster is up and running with OpenShift Local Storage Operator, the cluster configuration is validated by deploying a MongoDB pod with persistent volume and Yahoo Cloud Service Benchmarking (YCSB). This section covers the steps to validate the OpenShift Container Platform deployment.

PREREQUISITES

  • OCP 4.6 cluster must be installed.

  • Use local storage or OCS to claim persistent volume (PV).

  • MongoDB instance will only support local file system storage or OCS file system.

NOTE

Block storage is not supported.

# Deploying MongoDB application

  1. Login to the installer VM as a non-root user.

  2. Use the following command to download the Red Hat scripts specific to the MongoDB application at https://github.com/red-hat-storage/SAWORF (opens new window).

    > sudo git clone <https://github.com/red-hat-storage/SAWORF.git>  
    
  3. From within the red-hat-storage repository, navigate to the folder SAWORF/OCS3/MongoDB/blog2.

  4. Update the create_and_load.sh script with local storage, OCS , Nimble storage, and 3PAR storage in place of glusterfs content. Example is as follows.

    > mongodb_ip=$(oc get svc -n ${PROJECT_NAME} | grep -v **local storage** | grep mongodb | awk '{print $3}'
    
  5. Create MongoDB and YCSB pods and load the sample data.

  6. Update the following command with appropriate values for the command line parameters and execute the command to create the MongoDB and YCSB pods and also to load the sample data.

    > ./create_and_load_mongodb $PROJECT_NAME $OCP_TEMPLATE $MONGODB_MEMORY_LIMIT $PV_SIZE $MONGODB_VERSION $YCSB_WORKLOAD $YCSB_DISTRIBUTION $YCSB_RECORDCOUNT $YCSB_OPERATIONCOUNT $YCSB_THREADS $LOG_DIR
    

    Example command is shown as follows.

    > ./create_and_load_mongodb dbtest mongodb-persistent 4Gi 10Gi 3.6 workloadb uniform 4000 4000 8 root /mnt/data/
    

    The output is as follows.

    > Deploying template "openshift/mongodb-persistent" to project dbtest
    
     MongoDB
    
    ---------
    
    > MongoDB database service, with persistent storage. For more information about using this template, including OpenShift considerations, see documentation in the upstream repository: https://github.com/sclorg/mongodb-container.
    
    
    NOTE: Scaling to more than one replica is not supported. You must have persistent volume available in your cluster to use this template.
    
    The following service(s) have been created in your project: mongodb.
    
    Username: redhat
    
    Password: redhat
    
    Database Name: redhatdb
    
    Connection URL: mongodb://redhat:redhat@mongodb/redhatdb
    
    For more information about using this template, including OpenShift considerations, see documentation in the upstream repository: https://github.com/sclorg/mongodb-container.
    
    With parameters:
    
        * Memory Limit=4Gi
    
        * Namespace=openshift
    
         * Database Service Name=mongodb
    
         * MongoDB Connection Username=redhat
    
         * MongoDB Connection Password=redhat
    
         * MongoDB Database Name=redhatdb
    
         * MongoDB Admin Password=redhat
    
         * Volume Capacity=10Gi
    
         * Version of MongoDB Image=3.6
    
    > Creating resources ...
    
         secret "mongodb" created
    
         service "mongodb" created
    
         error: persistentvolumeclaims "mongodb" already exists
    
         deploymentconfig.apps.openshift.io "mongodb" created
    
    > Failed
    
     pod/ycsb-pod created
    
    
  7. Execute the following command to run the check_db_size script.

    > ./check_db_size $PROJECT_NAME
    

    The output is as follows.

    
    
     MongoDB shell version v3.6.12
    
     connecting to: mongodb://172.x.x.x:27017/redhatdb?gssapiServiceName=mongodb
    
     Implicit session: session {"id" : UUID("c0a76ddc-ea0b-4fc-88fd-045d0f98b2") }
    
     MongoDB server version: 3.6.3
    
     {
    
                   "db" : "redhatdb",
    
                   "collections" : 1,
    
                   "views" : 0,
    
                   "objects" : 4000,
    
                   "avgObjSize" : 1167.877,
    
                   "dataSize" : 0.004350680857896805,
    
                   "storageSize" : 0.00446319580078125,
    
                   "numExtents" : 0,
    
                   "indexes" : 1,
    
                   "indexSize" : 0.0001068115234375,
    
                   "fsUsedSize" : 1.0311393737792969,
    
                   "fsTotalSize" : 99.951171875,
    
                   "ok" : 1
    
     }
    
    

# Verifying MongoDB pod deployment

  1. Execute the following command to verify the persistent volume associated with MongoDB pods.
> oc get pv|grep mongodb
  1. The output is as follows.
> local-pv-e7f10f65 100Gi RWO Delete Bound dbtest/mongodb local-sc 26h
  1. Execute the following command to verify the persistent volume claim (PVC) associated with MongoDB pods.
> oc get pvc 
  1. The output is as follows.
> local-pv-e7f10f65 100Gi RWO Delete Bound dbtest/mongodb local-sc 26h
  1. Execute the following command to ensure MongoDB and YCSB pods are up and running.
> oc get pod
    The output is as follows.


        NAME               READY   STATUS      RESTARTS   AGE

        mongodb-1-deploy   0/1     Completed   0          3m40s

        mongodb-1-skbwq    1/1     Running     0          3m36s

        ycsb-pod           1/1     Running     0          3m41s

NOTE

For more information about deploying MongoDB application along with YCSB, refer to the Red Hat documentation at https://www.redhat.com/en/blog/multitenant-deployment-mongodb-using-openshift-container-storage-and-using-ycsb-test-performance (opens new window).