LAB 1

Install OpenShift Container Platform

LAB GOAL

To install and login to OpenShift Container Platform

PREVIEW OCP INSTALL

OpenShift Container Platform installation video

ARCHITECTURE

Installing OpenShift Container Platform

INTERMEZZO

UNDER THE HOOD: WHAT'S IN AN OCP INSTALL?

  1. Checks for dependencies to support install (OCP, engine, oc client, VM)
  2. Pre-configures a specific docker-machine (VM)
  3. oc client pulls OCP image from Red Hat registry to install on previously specific pre-configured docker-machine (VM)

INTERMEZZO

UNDER THE HOOD: DEPENDENCY CHECKS?

  1. Checks for KVM or VirtualBox install and version validation
  2. Checks for container engine install and version validation
  3. Checks for running container engine
  4. Checks for oc client tool install and version validation

INTERMEZZO

UNDER THE HOOD: PRE-CONFIGURED VM?

  1. Using docker-machine as tool for defining a VM
  2. Specify the VM driver, cpu allocation, memory allocation, identify our internal insecure VM registry
  3. Specify VM image boot2docker url, specify dependency on docker 1.13 for OCP in VM
  4. Name VM openshift, important to provide target to stop and start VM later...

INTERMEZZO

UNDER THE HOOD: INSTALL OCP ON THE VM?

  1. Using oc client to spin up OCP on previously defined VM
  2. Specifically, using: oc cluster up, but need OCP instead of community OpenShift) and persistence configuration for stop / restarting
  3. Specify Red Hat registry image to pull: registry.access.redhat.com/openshift3/ose
  4. Specify persistence configurations; data directory, ocp configuration and pv directory
  5. Specify use of openshift VM and specify version oc client

REQUIREMENTS

INSTALL VIRTUALBOX

Mac and Windows users need to install Virtual Box.

During OCP install, possible error:


Fix:
  • Download and install VirtualBox as indicated.

REQUIREMENTS

INSTALL DOCKER

Everyone needs an engine installed and running.

During OCP install, possible errors:

Fix:
  • Download, install and start Docker version needed.

REQUIREMENTS

INSTALL DOCKER

Everyone needs an engine installed and running.

During OCP install, possible errors:
  • "docker-machine: command not found"

  • "Error occurred during openshift docker machine creation..."


Fix:
  • Missing 'docker-machine' command, install:
    • $ curl -L https://github.com/docker/machine/releases/download/v0.12.2/docker-machine-`uname -s`-`uname -m` >/tmp/docker-machine && chmod +x /tmp/docker-machine && sudo cp /tmp/docker-machine /usr/local/bin/docker-machine

REQUIREMENTS

INSTALL OC CLIENT

Everyone needs OpenShift CLI tool 'oc' installed.

During OCP install, possible errors:

Fix:
  • Download and install OpenShift 'oc' client.
  • Contact me directly for a trial if no login available Red Hat Portal

INSTALL OCP

  • Download ocp-install-demo v2.1 and unzip
  • Run init.sh or init.bat (Windows needs admin privileges)
    • $ unzip ocp-install-demo-2.1.zip

    • $ cd ocp-install-demo-2.1

    • $ ./init{-win10}.{sh|bat}

  • See next slides for dealing with any issues

WATCHING INSTALL LOG

OCP image downloaded and installed...

WATCHING INSTALL LOG

Starting OCP image and getting IP address...

WATCHING INSTALL LOG

Adding JBoss images to OCP...

WATCHING INSTALL LOG

Adding integration, S2I and decision server images to OCP...

WATCHING INSTALL LOG

Refreshing RHEL images to OCP...

WATCHING INSTALL LOG

Adding .Net images to OCP...

WATCHING INSTALL LOG

Final output with details to log in, note clean up commands....

LOG IN TO OCP

Your IP address may differ, see console output
http://192.168.99.100:8443

  • user: openshift-dev

  • password: devel

STOP / RESTART OCP

GOOD NEWS, IT'S PERSISTENT...

Persistence is enabled, so to shutdown and restart the openshift cluster with your projects in place DO NOT run the following commands:

# This will remove the installation:
$ docker-machine rm -f openshift

# This will initialized OCP:
$ ./init.sh


Instead, see the following slide...

SHUTDOWN OCP

STOP OPENSHIFT CLUSTER

Shutdown the openshift cluster with your projects in place as follows:

# shutdown using:
$ oc cluster down --docker-machine=openshift

$ docker-machine stop openshift

RESTART OCP

RESTART OPENSHIFT CLUSTER

Restart the openshift cluster with your projects in place as follows (remember, it takes time for containers to start up):
# restart use the existing data and configuration:
$ docker-machine start openshift

$ oc cluster up --image=registry.access.redhat.com/openshift3/ose \
--host-data-dir=/var/lib/boot2docker/ocp-data \
--docker-machine=openshift \
--host-config-dir=/var/lib/boot2docker/ocp-config \
--use-existing-config=true --host-pv-dir=/var/lib/boot2docker/ocp-pv

END LAB 1

QUESTIONS?

Eric D. Schabell
Portfolio Architect Director
@ericschabell
http://schabell.org

UP NEXT...

Lab 2 - Install JBoss BRMS