Cloud Architecture / DevOps / DevOps - Learning Track / Methodology / OpenShift / PaaS

DevOps – Learning Track

 

Application Centric Automation

OpenShift makes it easy to use powerful orchestration tools such as Kubernetes together with container image formats such as docker to build application centric automation. Keen to just get started? Go straight to the Installation section then try one of the Labs.

untitled

Still reading? Use of Kubernetes and docker primitives can be fully abstracted for those not concerned with such details. This makes for a compelling technology platform to enable DevOps capabilities accessible to “Citizen Developers” through to 10x Programmers. Now, that’s too many words, show me some slides instead! No problem, check out the slide deck used for the 2017 DevOps with OpenShift Meetup series we did in ANZ.

Whoa! That’s a lot of high level pictures. Now I’d prefer some dense text. We can do that. Download the free eBook.

devops-with-openshift

Quick Links

About
Environment

Installation

Curriculum

The MiniLabs

Appendix

A DevOps Tutorial

This tutorial curates a series of OpenShift-based mini labs demonstrating a particular DevOps automation use case, so hey, let’s call them minilabs, because we can. Does that sounds all very technology centric? Were you hoping for something more human friendly? Then have a look at this slideshare which has some accompanying text if you’re keen.

Pattern

Each minilab topic points to a seperate blog post entry following the pattern as summarised below. While the emphasis is more practice than theory, each presents an exemplar that can be later generalised or refactored.

Introduction – A short teaser setting the scene of why this topic matters.

Objectives – Learning and demonstration outcomes.

Setup – Getting started steps including how to reset the tutorial.

Instructions – Steps to reproduce the demonstration use case.

Trivia – Useful and interesting resources for follow up.

Worked Examples

Note that the worked examples favour a command-line interface (CLI) style rather than using graphical (GUI) tools. This is deliberate as the CLI approach makes it easier for DevOps interested users to later reproduce and automate. The CLI calls are typically self-evident, but the reader is encouraged to use the onboard --help and/or replicate the example using the OpenShift Console at their convenience.

Environment

oc cluster up

The minilabs can be followed from the safety and comfort of your own laptop. OpenShift is launched using the “oc cluster up” feature. This is a simple command that launches an OpenShift cluster for local workstation research and development as a single (master/node) instance. To make this even easier, several convenience wrapper tools are available that provide support for stateful profiles. This enables us to label, separate and save multiple different OpenShift cluster work environments within the same operation system instance. The OpenShift MiniLab series environment has been documented and tested using Mac OS/X (Sierra) and Windows 10 (PowerShell).

Sample Application

The sample application used for many of the tutorials is known as COTD. It is a PHP and jQuery Mobile based web application that shows an ordered list of items. Each page consists of an image with a small trivia comment and the user can step through and rate any item. The application can display different content by changing the theme via an environment variable (SELECTOR). Three of the included themes feature a list of “pets, “cats” and “cities” – hence the origin of the name COTD, or “Cat/City of the Day”. The default theme, “pets” is collected from amongst my work colleagues. Inspect a running instance of COTD featuring one of our star pets, Tipsy.

tipsy

Installation

Follow the instructions detailed at: Getting started with oc cluster up/down to set up your Linux, Mac OS/X or Windows 10 environment.

MiniLab Environment

Create a working directory and clone down the latest version of some useful lab support artefacts.

$ mdkir ~/containersascode
$ cd ~/containersascode
$ git clone https://github.com/StefanoPicozzi/cotd.git

Launch OpenShift Cluster

Finally its time to start an OpenShift cluster. Described here is the launch instruction using the oc-cluster-wrapper tool. Yes, its this easy. The other cluster up techniques behave similarly, check Getting started with oc cluster up/down for details specific to your environment.

The “containersascode” parameter sets this up as a named profile so that the system state (configuration) is preserved on restart. The first launch will take a few minutes as it pulls down the OpenShift Origin distribution. Once started verify the cluster is operational as per below. Login to the Console if you wish using credentials developer/developer, then try a restart.

$ oc-cluster up containersascode
$ oc login -u system:admin
$ oc project default
$ oc get pods
$ oc-cluster down
$ oc-cluster up containersascode

Refresh

Once you have successfully completed the installation procedures, do the following to refresh and restart before each lab. From time to time it is worth reviewing the Getting started with oc cluster up/down to pull down any updates of the oc client tools or for the launch technique of your preference, e.g. powershift, oc-cluster-wrapper or CLI.

$ cd ~/containersascode
$ cd cotd; 
$ git pull
$ oc-cluster down
$ oc-cluster up containersascode

Curriculum

Prerequisites

If you’ve got to here you have probably self-selected yourself as someone who has a background knowledge of this content and its importance. The labs to follow assume an introductory familiarity with using OpenShift. The OpenShift for Developers  eBook is a great place to start.

Background Reading

Read the first few chapters of DevOps with OpenShift – Cloud Deployments Made Easy.

The MiniLabs

Getting started with oc cluster up/down

taffy

Summarised here are not just one, but three different approaches to getting started with setting up a local OpenShift cluster lab environment. Pick your favourite and away you go. Also read Chapter 1 of  DevOps with OpenShift – Cloud Deployments Made Easy.

Storage

billy_2

Persistence and stateful behaviour is not going anywhere soon. OpenShift solves the problem of provisioning and managing persistent volume claims by ephemeral work loads such as containers. It take just a few simple steps which are described in this tutorial. Also read Chapter 1 of   DevOps with OpenShift – Cloud Deployments Made Easy.

Cloud Deployments

billy_2

Cats or cities? I can’t decide. Try out the A/B deployment here. Then read Chapter 3 of DevOps with OpenShift – Cloud Deployments Made Easy.

CI/CD Pipelines

snugglesA small step towards demystifying CI/CD. Read Chapter 4 of DevOps with OpenShift – Cloud Deployments Made Easy.

 

 

Webhooks

neo

An OpenShift image build can be triggered by a push event in your git-based source code repository. This enables an easy integration of third party CI/CD tool chains to OpenShift as a container management host. A north/south separation of concerns, if you so will. Try this feature for yourself in this tutorial.

Configuration Management

selbyYou shouldn’t externalise your problems. But I can’t say the same for your application configuration. Read Chapter 5 of the book DevOps with OpenShift – Cloud Deployments Made Easy.

 

Secrets

cookie

If you’re not a merchant banker, a cyber security analyst is the next best thing. Read Chapter 5 of DevOps with OpenShift – Cloud Deployments Made Easy.

 

 

Decision Service using DIY S2I

milo

One way we can empower all those “Citizen Developers” is to make it as easy as possible to build useful container based applications, without needing to know container implementation details. Source-to-image (S2I) builds and deploy a container from source using a recipe, many of which ship with OpenShift. This example shows how to create or customise your own S2I to build a business rules service. Also read Chapter 6 of DevOps with OpenShift – Cloud Deployments Made Easy.

Metrics

neo

Check out the blog page. Hunt down the OpenShift blogs and Commons youtube clips. Then read Chapter 7 of the book DevOps with OpenShift – Cloud Deployments Made Easy.

 

 

Log Aggregation

bogorAnother IT lifestyle choice. Log management. ad Chapter 7 of DevOps with OpenShift – Cloud Deployments Made Easy.

 

Minishift with JBoss EAP

deedee

Itching too try out minishift? Here you go and with a JBoss EAP sample application to boot.

Node.js with Redis

milky

An asynchronous match made in heaven? No. Just a matter of refactoring an existing template.

 

Messing with Registries

billie2

Some messing around to show some usage of the docker tag, login, push commands to move image assets between different registries.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s