This is the infrastructure code for a just-ask deployment to manage github org membership into bcgov/bcdevops
This app is managed by github actions. On Merge to:
main
an action will redeploy the infrastructure code using an ansible playbook to production.test
an action will redeploy the infrastructure code using an ansible playbook to test.ansible-playbook create-sa.yaml
OPENSHIFT_SA_PASSWORD
` oc get secret just-ask-token-OPENSHIFT_SERVER_URL
There are several secrets you will need to grab from the Github App that has been installed on Github. Things like the private key, client secret, client id, and __app_id__. Obtain those and store as github secret as such:
There are also secrets needed for the database.
Make a PR and apply the 'merge when ready' label when everythings approved! The PR will auto merge and a github action will take care of the rest.
Database backups on OCP 4.x is done with the backup-container
. Setup is straight forward.
backup.conf
configmap by running the backup-container
playbook and then apply in the prod namespacecurl https://raw.githubusercontent.com/BCDevOps/backup-container/master/openshift/templates/backup/backup-build.yaml |
oc process -f - -p NAME=just-ask-backup -p DOCKER_FILE_PATH=Dockerfile_Mongo -p OUTPUT_IMAGE_TAG=1.0.0 -p BASE_IMAGE_FOR_BUILD=registry.access.redhat.com/rhscl/mongodb-36-rhel7 | oc apply -f -
curl https://raw.githubusercontent.com/BCDevOps/backup-container/master/openshift/templates/backup/backup-deploy.yaml | sed -e 's/DATABASE_USER$/JUST_ASK_DB_USER/; s/DATABASE_PASSWORD$/JUST_ASK_DB_PASSWORD/' | oc process -f - -p NAME=just-ask-backup -p SOURCE_IMAGE_NAME=just-ask-backup -p APP_NAME=just-ask -p CPU_LIMIT=1000m -p MEMORY_LIMIT=1Gi -p NAMESPACE_NAME=<prod namespace> -p CPU_REQUEST=300m -p MEMORY_REQUEST=500Mi -p ENVIRONMENT_NAME=prod -p IMAGE_NAMESPACE=<tools namespace> -p TAG_NAME=1.0.0 -p DATABASE_DEPLOYMENT_NAME=just-ask-db | oc apply -f -