Skip to content

Commit

Permalink
added demoapp README and updated template
Browse files Browse the repository at this point in the history
  • Loading branch information
ruromero committed Jan 19, 2018
1 parent 6548775 commit 4559479
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 4 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,10 @@ This laboratory is intended to be deployed using [minishift](https://github.com/
oc login -u system:admin
```

2. Download the add-on and install it
2. Download the add-on and install it. Check the [latest release](https://github.com/ruromero/devconf/releases/latest):

```
$ wget https://github.com/ruromero/devconf/releases/download/v1.0/bf-addons.tar.gz
$ wget https://github.com/ruromero/devconf/releases/download/v1.1/bf-addons.tar.gz
$ tar -xf bf-addons.tar.gz
$ ./minishift addons install bf-addons
Addon 'bf-devconf' installed
Expand Down
8 changes: 6 additions & 2 deletions bf-addons/demoapp-template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -87,13 +87,17 @@ objects:
- name: ${APP_NAME}
image: ' '
readinessProbe:
failureThreshold: 3
httpGet:
path: /
port: 8080
scheme: HTTP
periodSeconds: 5
successThreshold: 1
timeoutSeconds: 1
livenessProbe:
httpGet:
path: /
port: 8080
scheme: HTTP
timeoutSeconds: 1
triggers:
- type: ConfigChange
Expand Down
47 changes: 47 additions & 0 deletions demoapp/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# demoapp

`demoapp` is a simple NodeJS-based application used in the *Break & Fix* workshop. It will be deployed using the [demoapp-template.yaml](../bf-addons/demoapp-template.yaml) file on OpenShift and the `manager-app` will then make
some changes on the cluster or the application objects to make it unavailable.

## The build and deployment process
The [BuildConfig](https://docs.openshift.com/container-platform/3.7/dev_guide/builds/index.html) defines how the application should be built before being deployed. The [S2I](https://docs.openshift.com/container-platform/3.7/creating_images/s2i.html#creating-images-s2i) builder image will clone the repository on the path specified in the `contextDir` and run `npm install`. The result is used to create the image that will be later deployed.

The [DeploymentConfig](https://docs.openshift.com/container-platform/3.7/dev_guide/deployments/how_deployments_work.html) defines where to pull the image from and how it is deployed. How many replicas, how to deploy a new image, how to check the application is successfully deployed ([Health checks using probes](https://docs.openshift.com/container-platform/3.7/dev_guide/application_health.html)).

Once the application is marked as ready (i.e. deployed and healthy), the [Service](https://docs.openshift.com/container-platform/3.7/architecture/core_concepts/pods_and_services.html#services) starts serving requests and load balancing across all the pods matching the `selector`. The [Route](https://docs.openshift.com/container-platform/3.7/architecture/networking/routes.html) provides external access through the router and will forward requests to the `service` being exposed.

## Source code
**Repository:**
* Type: Git
* URL: `https://github.com/ruromero/devconf`
* Context dir: `demoapp`

**Code:**
* Language: Javascript
* Server: NodeJS

**Build:**
* Type: Source to Image (`s2i`)
* Builder image: `centos/nodejs-6-centos7:latest`

## HTTP Requests

**Request**
* PORT: `8080`
* Path: `/`
* Method: `GET`

**Reply**
* Status code: `200 OK`
* Body: `Hello Break & Fix!`

## Deployment

* Replicas: `1`
* Strategy: `Recreate`
* Labels: `app=demoapp`
* **readinessProbe and livenessProbe**
* HTTP Verb: `GET`
* Path: '/'
* Port: `8080`
* Resources Limits/Requests: `none`

0 comments on commit 4559479

Please sign in to comment.