Appendix C. Seamless application movement across multicloud environments 243
                        TESTVAR=$(echo -n $TESTVAR)
                        echo "Pod status is $TESTVAR"
                        ssh -M -S mongoconnect -fNT -L 
27017:a1765d068fc8911e9b07106df2fba1c0-125393943.us-east-2.elb.amazonaws.com:27017 
localhost
                        echo "Tunneled to MongoDB running on AWS"
        fi
fi
sleep 30
done
Every 30 seconds, the script looks for the pod that is running in the public cloud or 
on-premises cloud. The script returns the status of the pod if the need exists to tunnel to 
another location, or the tunnel is correctly mapped to the location where the pod is running. 
The tunnel is opened to the localhost IP 127.0.0.1. Then, an alias is added on the local hosts 
file as yournetworksolution, which points to the localhost IP to make it transparent to the 
client.
Moving the application across clouds
The application movement is performed manually to make it easier to be seen. An automation 
script can be in place to decide where the database must be located. Also, IBM Cloud Pak for 
Multicloud Management is an option for controlling the APIs on any OpenShift clusters.
Starting the pod at Amazon Web Services
Run the example script as shown in Example C-1 on page 242. At the point when the pods 
are not running on any cloud, start them on the Amazon Web Services (AWS) cloud, as 
shown in Example C-2.
Example C-2   Starting MongoDB Cloud in AWS
[root@ip-10-0-2-217 ~]# oc apply -f mongo_pod.yaml
pod/appmongo-ibm-mongodb-dev created
[root@ip-10-0-2-217 ~]# oc get pod appmongo-ibm-mongodb-dev 
NAME                               READY   STATUS              RESTARTS   AGE
appmongo-ibm-mongodb-dev           0/1     ContainerCreating   0          3s