Why we moved from OpenShift to Google Cloud

The good old days

When OpenShift was in its version 1 it was great from the customer’s point of view with a low budget. OpenShift v1 had free offers to deploy apps and add a custom domain to it. There was no SSL support but it could be handled via the CloudFlare solution, making the overall solution a great one.

Then there comes OpenShift v2

RedHat then launched OpenShift v2 and added a restriction that gears will be shut down after a certain period of inactivity and also removed the support for custom domain.

That was the time that we had to move to some other cloud platform that could support our apps with low resources and without investing anything. Because all good things in life are free.

Google Cloud to the rescue

So we came across the Google Cloud platform offering and we had $300 credit in a free trial for 6 months. That was more than enough for us to start with. And in fact, they have micro virtual machine instances that are free for life with 30GB storage. That is more than enough for small apps to run for free that are under experiment or don’t have any monetization plans.

So, we migrated several of our apps from OpenShift to Google Cloud and started leveraging free credits provided by Google.

Just this week we consumed all our credit and our trial expired. Our virtual machine instances were shut down, but it didn’t take long before we enabled billing on our project and downgraded our instances to micro ones which are free. That gave us such a relief that our apps are still running although with low resources but it is fine as they are not our revenue-generating apps and are just experiments.

Click here to read more about Google.

How to use wildcard domain with OpenShift hosting?

If you have a domain name and want to use OpenShift for hosting then using a wildcard domain name is a bit tricky with some domain registrars like GoDaddy. The reason is IP address of the app on OpenShift doesn’t remain the same and to use the wildcard domain a DNS A record is setup with the IP address of the hosting server. So, how do we make sure the following is true:

  • user enters mysitename.com > user sees www.mysitename.com
  • user enters mysitename.com/about.html > user sees www.mysitename.com/about.html

That is, the www prefix is always displayed anywhere on the site.

But due to the non-static IP of the OpenShift app, it is not possible to adjust the A record. But you can set up a CNAME with the following:

www > appname-username.rhcloud.com

where the format for the OpenShift app is

http://appname-username.rhcloud.com.

This means the site is accessible at www.mysitename.com but not at mysitename.com. To make it work you need to do the following.

On domain registrar like GoDaddy
– Create a new Record with
Record Type CNAME
HOST: www
POINT TO: appname-username.rhcloud.com

  • Setup Forwarding
    Forward to: www.mysitename.com
    Redirect: 301 (Permanent)
    Type: Forward only

On Openshift
1. Select Application tab > select application appname-username.rhcloud.com > click change
2. Enter the Domain name www.mysitename.com

That’s it! Wait for 10-15 min and see the magic.