Guidance on OpenShift 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. Through the course of the book, you’ll learn how to use OpenShift and the Wildfly application server to build and then immediately deploy a Java application online.

This books explains how to:

  • Learn about OpenShift’s core technology, including Docker-based containers and Kubernetes

  • 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

  • Get a working environment up in minutes with application templates

  • Use commands to check and debug your application

  • Create and build Docker-based images for your application

 

OpenShift for Developers 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

 

​​​​​

Changing the strategy
Implementing Custom Strategies