We’ve made it possible to run FAF and required database inside Openshift in two separated containers. In this blog post, you will find information about the containers and how to deploy them in Openshift.
In the previous article FAF in Openshift we showed you how to set up FAF to run inside the Openshift. Though it required FAF and the database to be inside the same container. To address this problem we’ve made changes in the code to enable the FAF and the database to run in two different containers.
The following text describes how you can deploy the FAF with the new changes.
Versions of the used software
Database
FAF is using a PostgreSQL database extended by semver extension. Because of this, we can’t use the official PostgreSQL image as the semver extension isn’t available there. So we’ve created a new image with the database and the semver extension.
Set up the database
To make it as easy as possible to deploy the database in Openshift we’ve created a template for it.
faf-database-template.yml
Use either a terminal or web interface to create the template from the yaml file.
To create the template from a file in the terminal execute the following command:
oc create -f faf-database-template.yml
To import the file through the web interface click on Add to Project and select Import YAML/JSON.
Once you have the template created, you can use it to deploy the database.
The template sets up all necessary items to run the container (persistent volume, services, secrets, image streams).
Part of the deployment is a creation of the new user in the database to allow FAF to operate with it (there is 15s delay to allow the database to fully start).
Environmental variables used inside the container:
POSTGRESQL_ADMIN_PASSWORD, (FAF_USER, FAF_PASSWORD)
FAF
If you have the database ready, you can create the FAF application. The process of doing it is exactly the same as with the database.
The template for FAF is available here - faf-template.yml
Set up the FAF
Use either terminal or web interface to import the template to Openshift. To create a template from the file in the terminal execute:
oc create -f faf-template.yml
Once the template is created you can use it to deploy the FAF application.
The starting script of the container sets up the database and creates cron jobs for actions that will automatically process any incoming reports.
Environmental variables used inside the container for configuration:
PGUSER, PGPASSWORD, PGDATABASE, PGHOST, PGPORT
The Docker image for the FAF is available on our Docker Hub.