Skip to content

Latest commit

 

History

History
58 lines (43 loc) · 2.74 KB

docker-openshift.adoc

File metadata and controls

58 lines (43 loc) · 2.74 KB

OpenShift v3 (Optional Part, No Windows?)

OpenShift adds developer and operational centric tools on top of Kubernetes to enable rapid application development, easy deployment and scaling, and long-term lifecycle maintenance for small and large teams and applications.
— github.com/openshift/origin

OpenShift is Red Hat’s open source PaaS platform. OpenShift v3 (due to be released this year) will provide a holistic experience on running your microservices using Docker and Kubernetes. In a classic Red Hat way, all the work is done in the open source at OpenShift Origin. This will also drive the next major release of OpenShift Online and OpenShift Enterprise.

OpenShift v3 uses a new platform stack that is using plenty of community projects where Red Hat contributes such as Fedora, Centos, Docker, Project Atomic, Kubernetes, and OpenStack. OpenShift v3 Platform Combines Docker, Kubernetes, Atomic and More explain this platform stack in detail.

openshiftv3 stack

Download and Run OpenShift Origin

OpenShift Origin is available as a Docker container. It has all of the software prebuilt and pre-installed, but you do need to do a few things to get it going.

  1. Create a /var/lib/openshift folder on your Docker host. This volume will be mounted in the container to hold any data such that it is preserved after restart.

    docker-machine ssh lab "mkdir /var/lib/openshift"
  2. Download and run the OpenShift Origin container as:

    $ docker run -d --name "openshift-origin" --net=host --privileged \
    -v /var/run/docker.sock:/var/run/docker.sock \
    -v /var/lib/openshift:/var/lib/openshift \
    classroom.example.com:5000/openshift start
  3. Check that the container is running:

    > docker ps
    CONTAINER ID        IMAGE                     COMMAND                CREATED             STATUS              PORTS               NAMES
    df29f4cdff9e        openshift/origin:latest   "/usr/bin/openshift    57 seconds ago      Up 57 seconds                           openshift-origin

Run Java EE Application

Here is the deployment diagram of our application:

openshiftv3 wildfly mysql deployment
  1. WildFly and MySQL are running on separate pods.

  2. Each of them is wrapped in a Replication Controller to enable simplified scaling.

  3. Each Replication Controller is published as a Service.

  4. WildFly talks to the MySQL service, as opposed to directly to the pod. This is important as Pods, and IP addresses assigned to them, are ephemeral.

Lets get started!

  1. Docker host is already configured to trust insecure registry service. This registry will be used to push images for build/test/deploy cycle.