174 Red Hat OpenShift and IBM Cloud Paks on IBM Power Systems: Volume 1
[root@dcocp01 daniel]# oc apply -f nfspvc.yaml
persistentvolumeclaim/appmongo-ibm-mongodb-dev-datavolume created
[root@dcocp01 daniel]# oc apply -f secret.yaml
secret/appmongo-ibm-mongodb-dev created
[root@dcocp01 daniel]# oc apply -f service.yaml
service/appmongo-ibm-mongodb-dev created
[root@dcocp01 daniel]# oc apply -f mongo_pod.yaml
pod/appmongo-ibm-mongodb-dev created
[root@dcocp01 daniel]#
Example 7-19 shows the MongoDB Pod running, and the service correctly listening to the 
expected port.
Example 7-19   MongoDB Pod running and port 32767 listening for connections
[root@dcocp01 daniel]# oc get pod appmongo-ibm-mongodb-dev
NAME                       READY     STATUS    RESTARTS   AGE
appmongo-ibm-mongodb-dev   1/1       Running   0          7m
[root@dcocp01 daniel]# telnet localhost 32767
Trying ::1...
Connected to localhost.
Escape character is '^]'.
^]
telnet> quit
Connection closed.
[root@dcocp01 daniel]#
The first time you run the MongoDB with a clean pv, it creates the stateful files on the 
container path /var/lib/mongodb/data.