Red Hat OpenShifts Into the Cloud

108

Red Hat’s OpenShift is their new Platform as a Service (PaaS) cloud offering. OpenShift makes some big promises: power, speed, openness, and portability, the ultimate fast friendly PaaS. Will it deliver on these promises? Time will tell, and you can start testing it now for free.

What Does it Do?

OpenShift is a platform comprising Linux, the OpenShift software and services, and a cloud backend for developing, deploying, and managing cloud applications. Write your fine code on your own computer, push it to OpenShift, and it does the heavy lifting of compiling and deploying your application.

OpenShiftYou don’t have to worry about databases and application servers, or building and maintaining an application stack, or figuring out how to scale out your applications. Just code, git push and go. It supports multiple languages, frameworks, databases, middleware, and multiple cloud hosting providers. Currently the only provider available is Amazon Web Services (AWS), but someday users will have multiple choices of Red Hat-certified providers. It’s all built on free/open source software, except the OpenShift code, which Red Hat promises will be opened sometime in the future.

It’s easy to try it out, which is a refreshing change of pace from vendors who expect us to jump through multiple hoops before we even know what their products do. You don’t even need Red Hat or Fedora Linux, but can use any Linux, Mac, or Windows computer. Just register for an account, install the client software, and you’re ready to start. Currently it is in developer preview, so it’s all free. Someday Red Hat will charge money, but they’re not giving any pricing information yet, and they say there will always be a free level of service.

OpenShift has three different types of accounts to choose from: Express, Flex, and Power. Let’s see what we can do with these.

OpenShift Express

Express is the most limited type of OpenShift account. It’s hosted on a multi-tenant AWS account that Red Hat pays for; you don’t have to shell out so much as a penny. It supports Java, Perl, PHP, Python, and Ruby, and most popular frameworks for these languages, such as Spring, Rails, Symfony, Zend Framework, Django, Java EE, and many more. With Express you are limited to 5 applications and 250 megabytes of disk space, though you can request more, or open additional accounts. With an Express account you get only a command-line interface, and can write, manage, and deploy your applications.

Your first task is to log in and create your own domain name. (On Linux look for the OpenShift commands, such as rhc-create-domain, in /var/lib/gems/.) This will also automatically create an SSH public/private key pair for your Flex account. Let’s call our example domain tigger. It is a subdomain of rhcloud.com, so your new domain is tigger.rhcloud.com. When you create a new application, let’s call it piglet, then it becomes piglet-tigger.rhcloud.com.

What if you want to use your own domain name? You can do this. First you need a proper registered Internet domain name. Then in your own DNS manager create a CNAME for your OpenShift domain that points to your Internet domain name. Then use your OpenShift client software to create an alias in your Express account, like this:

$ rhc-ctl-app -a piglet -c add-alias --alias www.example.com

Of course, if your application name is not piglet you must use your real app name, and instead of example.com your own real Internet domain name.

Now you can write and upload an application, and have instant gratification seeing it go live. When you create a new application, OpenShift automatically creates both a remote and a local git repository. Publish it with git, and update it with git. You can save snapshots, which include all data and logfiles. Visit the Quickstart page to learn more.

Flex

An Express account may be all you ever need. If you want a graphical interface, if you want to create and manage servers, clusters, and cloud objects, and to have access to performance data, then Flex might be for you. A Flex account is in a dedicated hosting environment, rather than multi-tenanted like Express, and it includes shell access, monitoring, versioning, and auto-scaling. Flex only supports Java and PHP applications. It supports application servers like Tomcat, Apache, and JBoss, and you get a choice of databases such as MySQL, Membase, and MongoDB, and Memcache and Infinispan for data caching.

You get a nice complement of management tools, and can migrate your applications to different clusters, and can create, start, stop, and remove any of your cloud objects. A prerequisite is you need your own Amazon EC2 account. Though you can skip this by signing up for the free 30-day trial, which includes 30 days or 30 hours of Amazon EC2 at no cost to you. Note that the 30 hours include all the time your applications are running. This is truly a test drive, as your data and applications will be deleted at the end of the trial, and there are no service-level agreements. So, obviously, don’t use this for production work.

Power

The ultimate in features and flexibility is an OpenShift Power account. Or will be, anyway. Power accounts are not yet available, but when they are you will be able to deploy any Linux applications written in any language. It promises features like scripting templates, multi-virtual machine architectures that span clouds, “headless” apps (those with no Web interfaces), and deep customizability.

Red Hat has published two excellent OpenShift manuals: OpenShift Express User Guide and OpenShift Flex User Guide. There are active forums, an IRC channel, and howto videos. With all of this flexibility, speed, and ease-of-administration, Red Hat may have a chance to take the lead in the infant PaaS space.