GithubHelp home page GithubHelp logo

businessdaydemo's Introduction

JBoss Business Day 2017 - OpenShift in action

Based on Grant Shipleys MLB Parks example (https://github.com/gshipley/openshift3mlbparks)

This is a short demo of OpenShift 3, as part of Viada JBoss Business Day 2017 in Frankfurt.

This demo deals with developmental and operational issues and takes roughly a hour. You can find the presentation here!

If you want to reuse this demo, just follow the instructions at the bottom of the page.

Agenda

Build and Deploy an image

  1. Source to Image - Explanation - MLB Parks Template - Logs - Influence build process - Defining Health Checks
  2. Docker Strategy - How to use Docker Images - Logs
  3. Deployment Strategies - Recreate - Rolling
  4. Configuration - Config Maps - Secrets

Failover scenarios

  1. Pod crashes
  2. Health Checks fail

Logging & Debugging

  1. Debug Terminal
  2. EFK

Development Tools

  1. JBoss Tools
  2. oc cluster up
  3. minishift

How to use this demo

There are two ways to use this demo. You can use the 'start-demo.sh' script or you can do it step by step manually.

If you choosed the automated way then use the script this way and follow the steps in the script.

./start-demo.sh <OPENSHIFT_MASTER_URL> <PROJECTNAME> <PATH_TO_YOUR_CLONED_REPO> <EAP_OR_WILDFLY>

For example:

./start-demo.sh https://your-openshift-master.com:8443 businessDayDemo ~/path/to/repo wildfly

Otherwise you can do it manually! Login to your OpenShift instance, create a new project and clone this repo.

oc login $OPENSHIFT_MASTER_URL
oc new-project $PROJECTNAME
git clone https://github.com/Sifa91/businessDayDemo.git
cd $PATH_TO_YOUR_CLONED_REPO

Build and Deploy an image

  1. Source to Image
  • For explanation just use this presentation
  • First create the template in your project and process it
oc create -f mlbparks-template-wildfly.json
oc new-app --template=mlbparks-wildfly
  • To follow logs from any pod use
oc get pods
oc logs -f $POD_ID
  • You can influence the build process by adding a new directory in your root folder '.s2i/bin'
mkdir -p .s2i/bin
cp misc/scripts/assemble .s2i/bin/

Now commit your changes and push them to your repo. Afterwards trigger a new build and follow the logs

oc start-build mlbparks --follow
  • Now it is time to define some health checks and explain them. Be flexible! Show some scenarios by editing the DeploymentConfig live in the web interface
oc replace -f misc/scripts/dc-with-health-checks.yaml
  1. Docker Strategy
    Imagine you would like to use an image just for analysis, but you do not have one and there is no out of the box image that you could use. So you write your own, test it locally and use it as your analyze container in OpenShift now.
  • Create a new ImageStream and a BuildConfig that uses the docker strategy
oc create -f misc/scripts/is-analyze-image.yaml
oc create -f misc/scripts/bc-analyze-image.yaml
  • Now create a new build by using and have a look at the build log
oc start-build analyze --follow
  • It is time to run your analyze container! But first you need to figure out which IP your registry has. You can copy it from the 'pull spec' in your ImageStream
oc run analyze -it --image=$IMAGE_REGISTRY_IP/$PROJECTNAME/analyze --restart=Always
  1. Deployment Strategies
    Now it is time to explain the different kinds of deployment strategies based on the mlbparks DeploymentConfig. Start with 'Recreate'! Just do it live in the web interface
  • If you finished explaining 'recreate' follow these steps and explain what exactly happens. At this point you could make some code changes, push them and make a new build to show that the old version is active until the new pod is ready. (Hint: Use Eclipse and explain the JBoss Tools)
oc replace -f misc/scripts/dc-with-rolling-upgrade.yaml
  1. Configuration
  • If you would like to ENV multiple times, then you should use ConfigMaps
oc create -f misc/scripts/config-map.yaml
oc replace -f misc/scripts/dc-with-config-map.yaml

Navigate to the terminal in the web interface or use 'oc rsh $POD_ID' to show the new ENVs.

  • In some cases you would like to use a confidential file inside of a Pod, which should not be stored unencrypted in the platform. It is time for secrets!
oc create secret generic my-secret --from-file=misc/scripts/testfileforsecret.md
oc replace -f misc/scripts/dc-with-secrets.yaml

Navigate to the terminal in the web interface or use 'oc rsh $POD_ID' to show the mounted file.

Failover scenarios

  1. Pod crashes
  • Just use commands like 'oc delete pod $POD_ID' or 'exit 0' inside of the pod
  1. Health Checks fail
  • To show how Health Checks work and what they can do replace the DeploymentConfig and show what happens in the web interface.
oc replace -f misc/scripts/dc-with-failures.yaml

Logging & Debugging

  1. Debug Terminal
  • While the deployment is running you can find a link at the bottom of the page that directs you to a debug terminal   Debug Terminal
  1. EFK
  • You can show the EFK and explain what happens with all the logs

Development Tools

  1. JBoss Tools
  2. oc cluster up
  3. minishift

Links

businessdaydemo's People

Watchers

Joachim Schröder avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.