Skip to content

Commit

Permalink
OpenShift set-up instructions ALMOST working
Browse files Browse the repository at this point in the history
waiting for help in alfio-event#511
  • Loading branch information
vorburger committed Sep 30, 2018
1 parent 08d9e54 commit 5bd59d4
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 7 deletions.
56 changes: 51 additions & 5 deletions .s2i/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,50 @@ You'll either need to [locally install minishift](https://docs.openshift.org/lat
or need to create at least a FREE TRIAL ;-) account on [openshift.com](https://www.openshift.com).
Either way you'll use the OC CLI, and then thanks to the configuration in alf.io/.s2i/ can simply do:

TODO...
_TODO How to fully automate all this?_

oc new-project alf-io

_TODO How to give the service a better name than "postgresql-95-centos7" ?

_TODO How to use a secret for the password?_

oc new-app \
-e POSTGRESQL_USER=alfy \
-e POSTGRESQL_PASSWORD=237vnaw8zevbaacwzebt \
-e POSTGRESQL_DATABASE=alfio \
centos/postgresql-95-centos7

_TODO How to do this from the CLI?_ Use the OpenShift UI: Storage > Create Storage "alf.io-db".

_TODO How to do this from the CLI?_ Use the OpenShift UI: Applications > Deplyoment > postgres > Pause Rollouts,
Configuration: Remove the default empty dir volume, Add storage, Storage = "alf.io-db" (create above) & Mount Path = /var/lib/pgsql/data,
unpause rollouts.

oc new-app fabric8/s2i-java~https://github.com/vorburger/alf.io#openshift \
-e POSTGRES_ENV_POSTGRES_USERNAME=alfy \
-e POSTGRES_ENV_POSTGRES_PASSWORD=237vnaw8zevbaacwzebt \
-e POSTGRES_ENV_POSTGRES_DB=alfio \
-e POSTGRES_PORT_5432_TCP_ADDR=postgresql-95-centos7 \
-e POSTGRES_PORT_5432_TCP_PORT=5432

oc expose svc/alfio

oc logs -f bc/alfio

oc status

_TODO How to avoid having to do this??_ Use the OpenShift UI: Applications > Deployment > alfio > Edit YAML,
add a `containerPort: 8080` (like the existing 8778 & 9779), and then in Applications > Services > alfio > Edit YAML,
add an additional `port` etc. for 8080, and in Applications > Routes > alfio > Edit YAML
and change the from `targetPort: 8778-tcp` to `targetPort: 8080-tcp`.

Now open e.g. `http://alfio-alf-io.192.168.42.182.nip.io/` ...

_TODO Something is NOK with the 8080 port... auto-forwarding to 8443... see https://github.com/alfio-event/alf.io/issues/511 :-(_

_TODO How to add a healthcheck to Postgres._
_TODO How to have monitoring metrics for Postgres._


## Use s2i locally for testing, without OpenShift, just a local Docker
Expand All @@ -15,16 +58,19 @@ Either way you'll use the OC CLI, and then thanks to the configuration in alf.io

_TODO `--incremental=true` how-to?_

_TODO Postgres container, and data-source how-to?_


## Background

This content originally appeared on http://blog2.vorburger.ch.

It required some work in an S2I Java Builder to be smooth, see:
This also required some work in an S2I Java Builder to be smooth, see:

* https://github.com/fabric8io-images/s2i/issues/118
* https://github.com/fabric8io-images/s2i/issues/113
* https://github.com/fabric8io-images/s2i/issues/115
* https://github.com/vorburger/s2i-java-example/tree/gradle

Postgres container:

* https://docs.okd.io/latest/using_images/db_images/postgresql.html
* https://github.com/sclorg/postgresql-container

4 changes: 2 additions & 2 deletions .s2i/environment
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ SPRING_PROFILES_ACTIVE=http,jdbc-session
# POSTGRES_PORT_5432_TCP_ADDR=localhost
# POSTGRES_PORT_5432_TCP_PORT=5432
# POSTGRES_ENV_POSTGRES_DB=alfio
# POSTGRES_ENV_POSTGRES_USERNAME=alfio
# POSTGRES_ENV_POSTGRES_PASSWORD=alfio
# POSTGRES_ENV_POSTGRES_USERNAME=postgres
# POSTGRES_ENV_POSTGRES_PASSWORD=password

# see README.md for more information about what this is all about

0 comments on commit 5bd59d4

Please sign in to comment.