OpenShift Applications

Container Orchestration and Platform as a Service Solution Automates the deployment and management of containers

oc new-app

Creates a new application

  • API calls in the background:
  • BuildConfig
  • DeploymentConfig
  • ImageStream
  • service

oc new-app

Supports different sources

  • source
  • image
  • template

Compare builds

Source to Image (S2I)

Image is built from sources

  • automatic recognition of build strategy
  • automatic recognition of the programming language
  • automatic selection of the build image
oc new-app

Source to Image (S2I)

Track Build Output

oc logs -f bc/nodejs-ex


Existing image serves as source

OpenShift searches images in:

  • local ImageStreams
  • Docker Hub
oc new-app redis


Application is built from OpenShift template

oc new-app cakephp-mysql-example
oc new-app -f example/ose-template.json


Integrated OpenShift templates

oc get templates -n openshift

Application Management


Increase in the number of replicas of a Pod

oc scale --replicas=3 rc nodejs-ex
oc scale --replicas=3 dc nodejs-ex


Automatic scaling of pods

  • based on CPU utilization
  • Resource requests must be set.
  • Metrics/Heapster must be installed
oc autoscale dc nodejs-ex --min=2 --max=5


Status of the HorizontalPodAutoscaler

oc get hpa all

Rollout and rollback

manual rollout

oc rollout latest dc/ruby-ex

Rollback to previous deployment

oc rollout history dc/ruby-ex
oc rollback ruby-ex

Deployment strategies

How are application updates deployed?

  • Rolling (Default)
  • recruit
  • manually

Rolling Update

  • Stopping a Pod of the Old Version
  • Starting a Pod of the new version
  • Repeat until no pods of the old version are available

N-1 compatibility!

Recreate Update

When N-1 compatibility is unclear

  • Stopping all pods of the old version
  • Starting the pods of the new version

Only one version of the application in operation!

Lifecycle Hooks

Rolling and Recreate offer Hooks


  • pre
  • post


  • pre
  • mid
  • post

Best practices

Configure readinessProbe and livenessProbe


Pod is ready to accept traffic


Pod is functional