OpenShift guide for developers

By: Grant Shipley and Graham Dumpleton

Updated: 9/1/2016

OpenShift enables you to use Docker application containers and the Kubernetes cluster manager to automate the way you create, ship, and run applications. In the process of exploring OpenShift’s core technology, Docker-based containers, and Kubernetes, you will learn how to use OpenShift and the WildFly application server to build, and then immediately deploy a Java application online.

This book explains how to:

  • Use a virtual machine with OpenShift installed and configured on your local environment.

  • Create and deploy your first application on the OpenShift platform.

  • Add language runtime dependencies and connect to a database.

  • Trigger an automatic rebuild and redeployment when you push changes to the repository.

  • Use application templates to bring a working environment up in minutes.

  • Run commands to check and debug your application.

  • Create and build Docker-based images for your application.

Book cover

Access OpenShift for Developers now


Insight on OpenShift

“It turns out that Kubernetes is excellent at orchestrating and scheduling containers, but to have a platform that helps developers and sys admins deal with the piece most important to their “customers”—the application—something more is needed. The goal of OpenShift is to provide the best experience for developers and sysadmins developing, deploying, and running applications. In other words, OpenShift is a layer on top of Docker and Kubernetes that makes it accessible and easy for the developer to create applications and a platform that is a dream for operators to deploy containers on for both development and production workloads."

Changing the Strategy

At the time of writing, to change the deployment strategy we need to drop below the covers of what the OpenShift web console and command-line tools provide direct support for and edit the Deployment Configuration directly. To do this we are going to use the oc edit command:

oc edit dc/insults -o json

This command will start up an editor displaying the deployment configuration in JSON format. Find in the deployment configuration the “strategy” subsection located under the spec section. Replace this definition, substituting "Recreate" for the "type" attribute, as shown here:

"spec": {
  "strategy": {
  "type": "Recreate"

Access OpenShift for Developers now


Book cover