It comprises of 3 repos:
- https://github.com/containers-prague/demo-result-app/
- https://github.com/containers-prague/demo-voting-app/
- https://github.com/containers-prague/demo-worker/
Each represents a container which serves single purpose:
- Result App - displays results from Postgres
- Voting App - let's people vote and stores in Redis
- Worker - processes queue in Redis and pushes data to Postgres
Other (already mentioned) containers in the system are:
- Redis - queue of votes
- Postgres - "permanent" sotrage of results
This is based on https://github.com/alexvanboxel/k8s-docker-vote and addapted to work well with OpenShift
- Login in to OpenShift and create a project
- Run
./deploy.sh
- A lot of resources should be created in OpenShift
- Watch whole app start
- Vote;)
To try Blue/Green deployment of voting-app
, run ./deploy.sh blue-green
All images are built in OpenShift with use of s2i builds. All deployments are then triggered by new build. You can automate builds by using webhooks - e.g.
oc describe bc voting-app-worker | grep generic | grep URL | sed 's/\s*URL:\s*//'