Download latest OpenShift client
and run oc cluster up to setup a local cluster. If you encounter any problems
follow the diagnostic messages that appear on the screen, it is probably missing
packages (eg. docker) or necessary configuration changes.
Instantiate a postgresql instance. Depending on your needs there are two possibilies
here. You can either proceed with a single development instance (A) or a full HA
production one (B).
A. To deploy single development instance you can either use the web console or
the following command. With the former make sure to use the exact same values
as below command.
This deployment configuration will kick of an actual deployment of our postgresql
instance which leads to creating a Replication Controller
and a Pod.
NOTE: This setup uses an ephemeral storage, if you want to save your data you
should read about Persistence Volumes.
When the postgresql instance is up we need to drop the database and allow roundup
initialize it from scratch. To do so invoke the following commands, which will
get you connected to bpo-db pod and drop the database and add necessary access
rights to create a new one, instead:
oc rsh $(oc get pod -l deploymentconfig=bpo-db -o jsonpath='{.items[*].metadata.name}')
# psql
# drop database roundup;
# alter user roundup createdb;
B. To deploy full HA PostgreSQL using patroni project
invoke the following command:
NOTE: This needs to be performed only when you’re using a temporary database.
Since we need to initiate the database only once, we need to set an environment
variable (INIT_DATABASE), to tell the run script to do it:
oc set env deploymentconfig/bpo INIT_DATABASE=true
After the initial rollout this value should be cleared out:
oc set env deploymentconfig/bpo INIT_DATABASE-
Edit config/roundup.ini and change the line:
web = http://localhost:9999/python-dev/
So that it matches the route the app will be exposed under. You can easily check
that with oc get route/bpo. Afterwards you can create the necessary configuration:
About
This repository contains the code allowing to deploy http://bugs.python.org on OpenShift.
Usage
Download latest OpenShift client and run
oc cluster upto setup a local cluster. If you encounter any problems follow the diagnostic messages that appear on the screen, it is probably missing packages (eg. docker) or necessary configuration changes.Instantiate a postgresql instance. Depending on your needs there are two possibilies here. You can either proceed with a single development instance (A) or a full HA production one (B).
A. To deploy single development instance you can either use the web console or the following command. With the former make sure to use the exact same values as below command.
This will create the following resources:
This deployment configuration will kick of an actual deployment of our postgresql instance which leads to creating a Replication Controller and a Pod.
NOTE: This setup uses an ephemeral storage, if you want to save your data you should read about Persistence Volumes.
When the postgresql instance is up we need to drop the database and allow roundup initialize it from scratch. To do so invoke the following commands, which will get you connected to bpo-db pod and drop the database and add necessary access rights to create a new one, instead:
B. To deploy full HA PostgreSQL using patroni project invoke the following command:
This will create the following resources:
NOTE: You should copy the above template file and change
superuser-passwordandreplication-password. These arebase64encoded passwords.When the postgresql instance is up we need to create user roundup with appropriate password and add it rights to create a database.
Now it is time to prepare all the bits necessary to deploy bugs.python.org itself:
This will create the following resources:
NOTE: This needs to be performed only when you’re using a temporary database.
Since we need to initiate the database only once, we need to set an environment variable (
INIT_DATABASE), to tell therunscript to do it:After the initial rollout this value should be cleared out:
config/roundup.iniand change the line:So that it matches the route the app will be exposed under. You can easily check that with
oc get route/bpo. Afterwards you can create the necessary configuration: