8459ch07.fm Draft Document for Review December 11, 2019 1:55 pm Example 7-25 Service file for AWS Example 7-26 Applying all yaml files Example 7-27 Checking service created apiVersion: v1 kind: Service metadata: labels: app: appmongo-ibm-mongodb-dev name: appmongo-ibm-mongodb-dev spec: ports: - name: ibm-mongodb-dev port: 27017 protocol: TCP targetPort: 27017 selector: app: appmongo-ibm-mongodb-dev type: LoadBalancer [root@ip-10-0-2-217 ~]# oc apply -f csipv.yaml persistentvolume/appmongo-ibm-mongodb-dev-datavolume created [root@ip-10-0-2-217 ~]# oc apply -f csipvc.yaml persistentvolumeclaim/appmongo-ibm-mongodb-dev-datavolume created [root@ip-10-0-2-217 ~]# oc apply -f secret.yaml secret/appmongo-ibm-mongodb-dev created [root@ip-10-0-2-217 ~]# oc apply -f awsservice.yaml service/appmongo-ibm-mongodb-dev created [root@ip-10-0-2-217 ~]# oc apply -f mongo_pod.yaml pod/appmongo-ibm-mongodb-dev created [root@ip-10-0-2-217 ~]# [root@ip-10-0-2-217 ~]# oc get service appmongo-ibm-mongodb-dev NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE appmongo-ibm-mongodb-dev LoadBalancer 172.30.43.162 a1765d068fc8911e9b07106df2fba1c0-125393943.us-east-2.elb.amazonaws.com 27017:31725/TCP 9d [root@ip-10-0-2-217 ~]# The service is created by AWS. To get the address, check the service as shown in  Example 7-27. After applying all yaml files as shown in Example 7-26, Mongodb is available in AWS. 176  Red Hat OpenShift and IBM Cloud Paks on IBM Power Systems: Volume 1