Preface - Learning OpenShift (2014)

Learning OpenShift (2014)

Preface

Cloud computing and OpenShift particularly, is rapidly changing the way software engineers approach software development. OpenShift allows you to focus on what you love—writing software. This is accomplished by creating an environment where most of the system administration tasks are handled for you by the platform. This allows you to focus on your code instead of mundane tasks such as patching application servers with the latest security errata updates.

This might be your first exposure to OpenShift and Platform as a Service. To understand how OpenShift fits into the overall cloud computing landscape, it's important to understand the three most common types of cloud computing:

· Infrastructure as a Service (IaaS)

· Software as a Service (SaaS)

· Platform as a Service (PaaS)

IaaS provides IT organizations with the ability to quickly spin up machines in an on-demand fashion. This greatly increases the speed with which they are able to deliver servers to their customers. However, once the server has been created, they still need to perform all of the typical system administration tasks just as if the hardware were physical machines racked in their data center. This includes things such as installing the operating system, installing application servers and databases, performance tuning and monitoring of the services, and applying security errata. The dominant player in the IaaS market is Amazon and their EC2 offering.

With IaaS, the only thing provided is the hardware. You are typically responsible for bringing everything else that is required to deploy applications on the environment to the table.

At the complete other end of the spectrum is SaaS. In a SaaS environment, everything is provided for you, but you have little or no control over the software. A couple of common examples of SaaS type applications are Facebook or Salesforce.com for a companies' sales organization. Typically, in a SaaS model, the things you have to bring to the table are the users and their data.

OpenShift sits right in the middle of these two extremes. This type of environment is called a PaaS. With PaaS, everything is provided for you except the application code, the users, and their data.

In this book, we will learn how to the use the popular OpenShift Platform as a Service.

What this book covers

Chapter 1, Creating Your First OpenShift Application, explores how easy it is to get started with the OpenShift platform. We will create an OpenShift account, install the client tools, and then create and edit a PHP application.

Chapter 2, Creating and Managing Applications, introduces the basic techniques to manage applications that have been created in the OpenShift platform. You will learn the basics of cartridge management and use the mysql, cron, and metrics cartridges.

Chapter 3, Application Maintenance, covers administration tasks for your applications. You will learn how to stop and start applications, how to view logfiles, how to create custom logfiles, and how to SSH to the server your application is running on.

Chapter 4, Using an Integrated Development Environment, introduces the ability to use plugins provided for the Eclipse IDE to interact with the OpenShift platform.

Chapter 5, Creating and Deploying Java EE Applications, shows you how to develop and deploy Java EE-based applications to the OpenShift platform using the JBoss EAP application server. We will create a geospatial mapping application using LeafletJS and OpenStreetMap while also using MongoDB for our spatial queries.

Chapter 6, Creating and Deploying Spring Framework Java Applications, explores how to develop and deploy Spring-based applications using the Apache Tomcat servlet container. This chapter will focus on porting the Java EE code from the chapter to the Spring Framework, complete with MongoDB and REST services.

Chapter 7, Adding a Continuous Integration Environment to Applications, details how to use the Jenkins environment for applications deployed to the OpenShift platform.

Chapter 8, Using OpenShift for Team Development, introduces how to add and manage a team of developers who are all working on the same project that is deployed on OpenShift.

Chapter 9, Using the OpenShift Web Console, explores how to perform tasks, such as the application creation and deletion, using the web console. This chapter also explains how to use instant applications on the platform.

Chapter 10, Debugging Applications, shows you how to enable the remote debugging of Java applications as well as how to use port forwarding.

Chapter 11, Using the Marker and Action Hook System, explains how to plug in to the application deployment life cycle of applications. You will also learn how to enable things such as the hot deployment of applications and which version of the Java SDK to use.

Chapter 12, Scaling Applications, introduces the types of scaling that are available in the OpenShift platform and when it makes sense to use each one.

Chapter 13, Using the Do-It-Yourself Cartridge, explores how to extend the OpenShift environment to run binaries compatible with Red Hat Enterprise Linux in the platform. As an example, we cover how to install and run a newer version of the Tomcat servlet container than what is provided out of the box by the platform.

Appendix A, The RHC Command-line Reference, is a quick guide that shows you the available commands that we can use from the command line to interact with the OpenShift platform.

Appendix B, Getting Involved with the Open Source Project, explains the different ways in which we can get contribute to the upstream open source project that powers the OpenShift platform.

What you need for this book

In order to be successful with the examples in this book, some familiarity with software development is required. You will also need to run Linux, Microsoft Windows, or OS X and have the Ruby programming language installed.

Who this book is for

If you are a developer who wants to get up to speed with OpenShift, this book is ideal for you. A basic understand of how to use the command line is recommended in order to follow along the examples in the book.

Conventions

In this book, you will find a number of styles of text that distinguish between different kinds of information. Here are some examples of these styles and an explanation of their meaning.

Code words in text, database table names, folder names, filenames, file extensions, pathnames, dummy URLs, user input, and Twitter handles are shown as follows: "The app command will allow us to create and manage applications on the platform, while the cartridge command will allow us to add and manage embeddable cartridges."

A block of code is set as follows:

@Bean

public MappingJackson2JsonView jsonView() {

MappingJackson2JsonView jsonView = new MappingJackson2JsonView();

jsonView.setPrefixJson(true);

return jsonView;

}

Any command-line input or output is written as follows:

$ rhc app create springmlb tomcat7

New terms and important words are shown in bold. Words that you see on the screen, in menus or dialog boxes for example, appear in the text like this: "At the top of the web page, you will see a Download button, which will allow you to download the installation program for the language."

Note

Warnings or important notes appear in a box like this.

Tip

Tips and tricks appear like this.