From 79d92744aa5ba04c49a8c0940ef8105958baf787 Mon Sep 17 00:00:00 2001 From: dgboss Date: Thu, 12 Dec 2024 09:58:40 -0800 Subject: [PATCH] Streamline naming crunchydb cluster (#4175) --- docs/database/CLUSTER_DB.MD | 4 +--- openshift/scripts/common/envars | 1 + openshift/scripts/oc_cleanup_db.sh | 2 +- openshift/scripts/oc_deploy.sh | 4 ++-- ...oc_provision_backup_s3_postgres_cronjob.sh | 4 ++-- .../scripts/oc_provision_c_haines_cronjob.sh | 2 +- openshift/scripts/oc_provision_crunchy.sh | 1 + .../scripts/oc_provision_ec_gdps_cronjob.sh | 2 +- .../scripts/oc_provision_ec_hrdps_cronjob.sh | 2 +- .../scripts/oc_provision_ec_rdps_cronjob.sh | 2 +- .../oc_provision_fill_partition_job.sh | 2 +- .../oc_provision_grass_curing_cronjob.sh | 2 +- openshift/scripts/oc_provision_nats.sh | 2 +- .../scripts/oc_provision_noaa_gfs_cronjob.sh | 2 +- .../scripts/oc_provision_noaa_nam_cronjob.sh | 2 +- .../oc_provision_partitioner_cronjob.sh | 2 +- .../scripts/oc_provision_rdps_sfms_cronjob.sh | 2 +- .../oc_provision_viirs_snow_cronjob.sh | 2 +- ...c_provision_wfwx_hourly_actuals_cronjob.sh | 2 +- ...c_provision_wfwx_noon_forecasts_cronjob.sh | 2 +- openshift/templates/crunchy.yaml | 23 +++++++++---------- 21 files changed, 33 insertions(+), 34 deletions(-) diff --git a/docs/database/CLUSTER_DB.MD b/docs/database/CLUSTER_DB.MD index bde57717a..8d6c71e8a 100644 --- a/docs/database/CLUSTER_DB.MD +++ b/docs/database/CLUSTER_DB.MD @@ -113,8 +113,6 @@ Login to the OpenShift UI and use `patronictl list` to identify the new cluster' Create a PR with the following changes: -- Update `CRUNCHYDB_USER` to the new crunchydb pguser secret in all scripts in openshift/scripts. +- Update `CRUNCHY_NAME` in `envars` file to the new crunchydb cluster name (excluding the suffix) - Update `PATRONI_CLUSTER_NAME` in `deploy.yaml`. -Deploy the PR once approved. -See [database upgrade PR](https://github.com/bcgov/wps/pull/4100) for reference. diff --git a/openshift/scripts/common/envars b/openshift/scripts/common/envars index b0e2504f2..b6b6860ca 100644 --- a/openshift/scripts/common/envars +++ b/openshift/scripts/common/envars @@ -10,3 +10,4 @@ PATH_DEPLOY="${PATH_DEPLOY:-$(dirname ${0})/../templates/deploy.yaml}" PATH_NATS="${PATH_NATS:-$(dirname ${0})/../templates/nats.yaml}" PATH_NATS_SERVER_CONFIG="${PATH_NATS_SERVER_CONFIG:-$(dirname ${0})/../templates/nats_server.yaml}" TEMPLATE_PATH="${TEMPLATE_PATH:-$(dirname ${0})/../templates}" +CRUNCHY_NAME="${CRUNCHY_NAME:-wps-crunchydb-16}" \ No newline at end of file diff --git a/openshift/scripts/oc_cleanup_db.sh b/openshift/scripts/oc_cleanup_db.sh index 507bec861..6da482636 100755 --- a/openshift/scripts/oc_cleanup_db.sh +++ b/openshift/scripts/oc_cleanup_db.sh @@ -41,7 +41,7 @@ OC_CLEAN_DEPLOY="oc -n ${PROJ_TARGET} ${DELETE_OR_GET} \ OC_CLEAN_CRUNCHY="oc -n ${PROJ_TARGET} ${DELETE_OR_GET} \ PostgresCluster \ - -o name -l app=wps-crunchydb-16-${SUFFIX}" + -o name -l app=${CRUNCHY_NAME}-${SUFFIX}" OC_CLEAN_CONFIGMAPS="oc -n ${PROJ_TARGET} ${DELETE_OR_GET} \ configmaps \ diff --git a/openshift/scripts/oc_deploy.sh b/openshift/scripts/oc_deploy.sh index 69085c27f..5ca1406be 100755 --- a/openshift/scripts/oc_deploy.sh +++ b/openshift/scripts/oc_deploy.sh @@ -34,9 +34,9 @@ OBJ_NAME="${APP_NAME}-${SUFFIX}" OC_PROCESS="oc -n ${PROJ_TARGET} process -f ${PATH_DEPLOY} \ -p SUFFIX=${SUFFIX} \ -p PROJECT_NAMESPACE=${PROJ_TARGET} \ - -p POSTGRES_USER=wps-crunchydb-16-${SUFFIX} \ + -p POSTGRES_USER=${CRUNCHY_NAME}-${SUFFIX} \ -p POSTGRES_DATABASE=${POSTGRES_DATABASE:-${APP_NAME}} \ - -p CRUNCHYDB_USER=wps-crunchydb-16-${SUFFIX}-pguser-wps-crunchydb-16-${SUFFIX} \ + -p CRUNCHYDB_USER=${CRUNCHY_NAME}-${SUFFIX}-pguser-${CRUNCHY_NAME}-${SUFFIX} \ -p VANITY_DOMAIN=${VANITY_DOMAIN} \ ${SECOND_LEVEL_DOMAIN:+ "-p SECOND_LEVEL_DOMAIN=${SECOND_LEVEL_DOMAIN}"} \ ${GUNICORN_WORKERS:+ "-p GUNICORN_WORKERS=${GUNICORN_WORKERS}"} \ diff --git a/openshift/scripts/oc_provision_backup_s3_postgres_cronjob.sh b/openshift/scripts/oc_provision_backup_s3_postgres_cronjob.sh index 7925fec15..847c474eb 100755 --- a/openshift/scripts/oc_provision_backup_s3_postgres_cronjob.sh +++ b/openshift/scripts/oc_provision_backup_s3_postgres_cronjob.sh @@ -29,10 +29,10 @@ PROJ_TARGET="${PROJ_TARGET:-${PROJ_DEV}}" # Prepare variables for backups JOB_NAME="backup-postgres-${APP_NAME}-${SUFFIX}" IMAGE_NAMESPACE=${PROJ_TOOLS} -CLUSTER_NAME="wps-crunchydb-16-${SUFFIX}" +CLUSTER_NAME="${CRUNCHY_NAME}-${SUFFIX}" OC_PROCESS="oc -n ${PROJ_TARGET} process -f ${TEMPLATE_PATH}/backup-s3-postgres-cronjob.yaml \ - -p CRUNCHYDB_USER=wps-crunchydb-16-${SUFFIX}-pguser-wps-crunchydb-16-${SUFFIX} \ + -p CRUNCHYDB_USER=${CRUNCHY_NAME}-${SUFFIX}-pguser-${CRUNCHY_NAME}-${SUFFIX} \ -p JOB_NAME=${JOB_NAME} \ -p IMAGE_NAMESPACE=${IMAGE_NAMESPACE} \ -p APP_LABEL=${APP_NAME}-${SUFFIX} \ diff --git a/openshift/scripts/oc_provision_c_haines_cronjob.sh b/openshift/scripts/oc_provision_c_haines_cronjob.sh index 58b335bde..38cf389dc 100755 --- a/openshift/scripts/oc_provision_c_haines_cronjob.sh +++ b/openshift/scripts/oc_provision_c_haines_cronjob.sh @@ -35,7 +35,7 @@ OC_PROCESS="oc -n ${PROJ_TARGET} process -f ${TEMPLATE_PATH}/c_haines.cronjob.ya -p SUFFIX=${SUFFIX} \ -p POSTGRES_DATABASE=${POSTGRES_DATABASE:-${APP_NAME}} \ -p POSTGRES_USER=wps-crunchydb-${SUFFIX} \ --p CRUNCHYDB_USER=wps-crunchydb-16-${SUFFIX}-pguser-wps-crunchydb-16-${SUFFIX} \ +-p CRUNCHYDB_USER=${CRUNCHY_NAME}-${SUFFIX}-pguser-${CRUNCHY_NAME}-${SUFFIX} \ ${PROJ_TOOLS:+ "-p PROJ_TOOLS=${PROJ_TOOLS}"}" # Apply template (apply or use --dry-run) diff --git a/openshift/scripts/oc_provision_crunchy.sh b/openshift/scripts/oc_provision_crunchy.sh index 56272c596..2821817a5 100755 --- a/openshift/scripts/oc_provision_crunchy.sh +++ b/openshift/scripts/oc_provision_crunchy.sh @@ -34,6 +34,7 @@ EPHEMERAL_STORAGE=${EPHEMERAL_STORAGE:-'False'} OC_PROCESS="oc -n ${PROJ_TARGET} process -f ${TEMPLATE_PATH}/crunchy.yaml \ -p NAME=\"crunchy-${APP_NAME}-${SUFFIX}\" \ -p SUFFIX=\"${SUFFIX}\" \ +-p CRUNCHY_NAME=\"${CRUNCHY_NAME}\" \ -p TARGET_NAMESPACE=${PROJ_TARGET} \ ${BUCKET:+ " -p BUCKET=${BUCKET}"} \ ${DATA_SIZE:+ " -p DATA_SIZE=${DATA_SIZE}"} \ diff --git a/openshift/scripts/oc_provision_ec_gdps_cronjob.sh b/openshift/scripts/oc_provision_ec_gdps_cronjob.sh index dc65ef988..df825fb0d 100755 --- a/openshift/scripts/oc_provision_ec_gdps_cronjob.sh +++ b/openshift/scripts/oc_provision_ec_gdps_cronjob.sh @@ -36,7 +36,7 @@ OC_PROCESS="oc -n ${PROJ_TARGET} process -f ${TEMPLATE_PATH}/env_canada_gdps.cro -p SUFFIX=${SUFFIX} \ -p SCHEDULE=\"${SCHEDULE}\" \ -p POSTGRES_DATABASE=${POSTGRES_DATABASE:-${APP_NAME}} \ --p CRUNCHYDB_USER=wps-crunchydb-16-${SUFFIX}-pguser-wps-crunchydb-16-${SUFFIX} \ +-p CRUNCHYDB_USER=${CRUNCHY_NAME}-${SUFFIX}-pguser-${CRUNCHY_NAME}-${SUFFIX} \ ${PROJ_TOOLS:+ "-p PROJ_TOOLS=${PROJ_TOOLS}"} \ ${IMAGE_REGISTRY:+ "-p IMAGE_REGISTRY=${IMAGE_REGISTRY}"}" diff --git a/openshift/scripts/oc_provision_ec_hrdps_cronjob.sh b/openshift/scripts/oc_provision_ec_hrdps_cronjob.sh index 559a833af..47c074348 100755 --- a/openshift/scripts/oc_provision_ec_hrdps_cronjob.sh +++ b/openshift/scripts/oc_provision_ec_hrdps_cronjob.sh @@ -36,7 +36,7 @@ OC_PROCESS="oc -n ${PROJ_TARGET} process -f ${TEMPLATE_PATH}/env_canada_hrdps.cr -p SUFFIX=${SUFFIX} \ -p SCHEDULE=\"${SCHEDULE}\" \ -p POSTGRES_DATABASE=${POSTGRES_DATABASE:-${APP_NAME}} \ --p CRUNCHYDB_USER=wps-crunchydb-16-${SUFFIX}-pguser-wps-crunchydb-16-${SUFFIX} \ +-p CRUNCHYDB_USER=${CRUNCHY_NAME}-${SUFFIX}-pguser-${CRUNCHY_NAME}-${SUFFIX} \ ${PROJ_TOOLS:+ "-p PROJ_TOOLS=${PROJ_TOOLS}"} \ ${IMAGE_REGISTRY:+ "-p IMAGE_REGISTRY=${IMAGE_REGISTRY}"}" diff --git a/openshift/scripts/oc_provision_ec_rdps_cronjob.sh b/openshift/scripts/oc_provision_ec_rdps_cronjob.sh index 392418f02..6d590ac6e 100755 --- a/openshift/scripts/oc_provision_ec_rdps_cronjob.sh +++ b/openshift/scripts/oc_provision_ec_rdps_cronjob.sh @@ -37,7 +37,7 @@ OC_PROCESS="oc -n ${PROJ_TARGET} process -f ${TEMPLATE_PATH}/env_canada_rdps.cro -p SUFFIX=${SUFFIX} \ -p SCHEDULE=\"${SCHEDULE}\" \ -p POSTGRES_DATABASE=${POSTGRES_DATABASE:-${APP_NAME}} \ --p CRUNCHYDB_USER=wps-crunchydb-16-${SUFFIX}-pguser-wps-crunchydb-16-${SUFFIX} \ +-p CRUNCHYDB_USER=${CRUNCHY_NAME}-${SUFFIX}-pguser-${CRUNCHY_NAME}-${SUFFIX} \ ${PROJ_TOOLS:+ "-p PROJ_TOOLS=${PROJ_TOOLS}"} \ ${IMAGE_REGISTRY:+ "-p IMAGE_REGISTRY=${IMAGE_REGISTRY}"}" diff --git a/openshift/scripts/oc_provision_fill_partition_job.sh b/openshift/scripts/oc_provision_fill_partition_job.sh index 9d0f5e95f..0d39dccb7 100755 --- a/openshift/scripts/oc_provision_fill_partition_job.sh +++ b/openshift/scripts/oc_provision_fill_partition_job.sh @@ -22,7 +22,7 @@ JOB="job/fill-partition-data-${SUFFIX}" oc -n ${PROJ_TARGET} process -f ${TEMPLATE_PATH}/partition_filler_job.yaml \ -p SUFFIX=${SUFFIX} \ -p PG_DATABASE=${PG_DATABASE} \ - -p CRUNCHYDB_USER=wps-crunchydb-16-${SUFFIX}-pguser-wps-crunchydb-16-${SUFFIX} \ + -p CRUNCHYDB_USER=${CRUNCHY_NAME}-${SUFFIX}-pguser-${CRUNCHY_NAME}-${SUFFIX} \ -p PROJ_TOOLS=${PROJ_TOOLS} | jq '.items[0]' | oc -n ${PROJ_TARGET} create -f - # wait for the job to finish oc wait --for=condition=complete ${JOB} --timeout=3600s diff --git a/openshift/scripts/oc_provision_grass_curing_cronjob.sh b/openshift/scripts/oc_provision_grass_curing_cronjob.sh index 6dc93a8c4..f8f56b91e 100644 --- a/openshift/scripts/oc_provision_grass_curing_cronjob.sh +++ b/openshift/scripts/oc_provision_grass_curing_cronjob.sh @@ -36,7 +36,7 @@ OC_PROCESS="oc -n ${PROJ_TARGET} process -f ${TEMPLATE_PATH}/grass_curing.cronjo -p SUFFIX=${SUFFIX} \ -p SCHEDULE=\"${SCHEDULE}\" \ -p POSTGRES_DATABASE=${POSTGRES_DATABASE:-${APP_NAME}} \ --p CRUNCHYDB_USER=wps-crunchydb-16-${SUFFIX}-pguser-wps-crunchydb-16-${SUFFIX} \ +-p CRUNCHYDB_USER=${CRUNCHY_NAME}-${SUFFIX}-pguser-${CRUNCHY_NAME}-${SUFFIX} \ ${PROJ_TOOLS:+ "-p PROJ_TOOLS=${PROJ_TOOLS}"} \ ${IMAGE_REGISTRY:+ "-p IMAGE_REGISTRY=${IMAGE_REGISTRY}"}" diff --git a/openshift/scripts/oc_provision_nats.sh b/openshift/scripts/oc_provision_nats.sh index 69770b117..96991d73a 100755 --- a/openshift/scripts/oc_provision_nats.sh +++ b/openshift/scripts/oc_provision_nats.sh @@ -31,7 +31,7 @@ OC_PROCESS="oc -n ${PROJ_TARGET} process -f ${PATH_NATS} \ -p POSTGRES_DATABASE=wps \ ${MEMORY_REQUEST:+ "-p MEMORY_REQUEST=${MEMORY_REQUEST}"} \ ${MEMORY_LIMIT:+ "-p MEMORY_LIMIT=${MEMORY_LIMIT}"} \ - -p CRUNCHYDB_USER=wps-crunchydb-16-${SUFFIX}-pguser-wps-crunchydb-16-${SUFFIX} \ + -p CRUNCHYDB_USER=${CRUNCHY_NAME}-${SUFFIX}-pguser-${CRUNCHY_NAME}-${SUFFIX} \ -p APP_NAME=${APP_NAME}" # Apply a template (apply or use --dry-run=client) diff --git a/openshift/scripts/oc_provision_noaa_gfs_cronjob.sh b/openshift/scripts/oc_provision_noaa_gfs_cronjob.sh index 848107a88..b2f6bc904 100644 --- a/openshift/scripts/oc_provision_noaa_gfs_cronjob.sh +++ b/openshift/scripts/oc_provision_noaa_gfs_cronjob.sh @@ -38,7 +38,7 @@ OC_PROCESS="oc -n ${PROJ_TARGET} process -f ${TEMPLATE_PATH}/noaa_gfs.cronjob.ya -p SUFFIX=${SUFFIX} \ -p SCHEDULE=\"${SCHEDULE}\" \ -p POSTGRES_DATABASE=${POSTGRES_DATABASE:-${APP_NAME}} \ --p CRUNCHYDB_USER=wps-crunchydb-16-${SUFFIX}-pguser-wps-crunchydb-16-${SUFFIX} \ +-p CRUNCHYDB_USER=${CRUNCHY_NAME}-${SUFFIX}-pguser-${CRUNCHY_NAME}-${SUFFIX} \ ${PROJ_TOOLS:+ "-p PROJ_TOOLS=${PROJ_TOOLS}"} \ ${IMAGE_REGISTRY:+ "-p IMAGE_REGISTRY=${IMAGE_REGISTRY}"}" diff --git a/openshift/scripts/oc_provision_noaa_nam_cronjob.sh b/openshift/scripts/oc_provision_noaa_nam_cronjob.sh index d4e9937bf..f46b5bf5f 100644 --- a/openshift/scripts/oc_provision_noaa_nam_cronjob.sh +++ b/openshift/scripts/oc_provision_noaa_nam_cronjob.sh @@ -36,7 +36,7 @@ OC_PROCESS="oc -n ${PROJ_TARGET} process -f ${TEMPLATE_PATH}/noaa_nam.cronjob.ya -p SUFFIX=${SUFFIX} \ -p SCHEDULE=\"${SCHEDULE}\" \ -p POSTGRES_DATABASE=${POSTGRES_DATABASE:-${APP_NAME}} \ --p CRUNCHYDB_USER=wps-crunchydb-16-${SUFFIX}-pguser-wps-crunchydb-16-${SUFFIX} \ +-p CRUNCHYDB_USER=${CRUNCHY_NAME}-${SUFFIX}-pguser-${CRUNCHY_NAME}-${SUFFIX} \ ${PROJ_TOOLS:+ "-p PROJ_TOOLS=${PROJ_TOOLS}"} \ ${IMAGE_REGISTRY:+ "-p IMAGE_REGISTRY=${IMAGE_REGISTRY}"}" diff --git a/openshift/scripts/oc_provision_partitioner_cronjob.sh b/openshift/scripts/oc_provision_partitioner_cronjob.sh index 921ebeeb3..cda6062de 100644 --- a/openshift/scripts/oc_provision_partitioner_cronjob.sh +++ b/openshift/scripts/oc_provision_partitioner_cronjob.sh @@ -32,7 +32,7 @@ OC_PROCESS="oc -n ${PROJ_TARGET} process -f ${TEMPLATE_PATH}/partitioner.cronjob -p SUFFIX=${SUFFIX} \ -p SCHEDULE=\"${SCHEDULE}\" \ -p PG_DATABASE=${POSTGRES_DATABASE:-${APP_NAME}} \ --p CRUNCHYDB_USER=wps-crunchydb-16-${SUFFIX}-pguser-wps-crunchydb-16-${SUFFIX} \ +-p CRUNCHYDB_USER=${CRUNCHY_NAME}-${SUFFIX}-pguser-${CRUNCHY_NAME}-${SUFFIX} \ ${PROJ_TOOLS:+ "-p PROJ_TOOLS=${PROJ_TOOLS}"}" # Apply template (apply or use --dry-run) diff --git a/openshift/scripts/oc_provision_rdps_sfms_cronjob.sh b/openshift/scripts/oc_provision_rdps_sfms_cronjob.sh index 1722b76fd..35b3d41e9 100644 --- a/openshift/scripts/oc_provision_rdps_sfms_cronjob.sh +++ b/openshift/scripts/oc_provision_rdps_sfms_cronjob.sh @@ -36,7 +36,7 @@ OC_PROCESS="oc -n ${PROJ_TARGET} process -f ${TEMPLATE_PATH}/rdps_sfms.cronjob.y -p SUFFIX=${SUFFIX} \ -p SCHEDULE=\"${SCHEDULE}\" \ -p POSTGRES_DATABASE=${POSTGRES_DATABASE:-${APP_NAME}} \ --p CRUNCHYDB_USER=wps-crunchydb-16-${SUFFIX}-pguser-wps-crunchydb-16-${SUFFIX} \ +-p CRUNCHYDB_USER=${CRUNCHY_NAME}-${SUFFIX}-pguser-${CRUNCHY_NAME}-${SUFFIX} \ ${PROJ_TOOLS:+ "-p PROJ_TOOLS=${PROJ_TOOLS}"} \ ${IMAGE_REGISTRY:+ "-p IMAGE_REGISTRY=${IMAGE_REGISTRY}"}" diff --git a/openshift/scripts/oc_provision_viirs_snow_cronjob.sh b/openshift/scripts/oc_provision_viirs_snow_cronjob.sh index d3b014b23..b40809302 100644 --- a/openshift/scripts/oc_provision_viirs_snow_cronjob.sh +++ b/openshift/scripts/oc_provision_viirs_snow_cronjob.sh @@ -36,7 +36,7 @@ OC_PROCESS="oc -n ${PROJ_TARGET} process -f ${TEMPLATE_PATH}/viirs_snow.cronjob. -p SUFFIX=${SUFFIX} \ -p SCHEDULE=\"${SCHEDULE}\" \ -p POSTGRES_DATABASE=${POSTGRES_DATABASE:-${APP_NAME}} \ --p CRUNCHYDB_USER=wps-crunchydb-16-${SUFFIX}-pguser-wps-crunchydb-16-${SUFFIX} \ +-p CRUNCHYDB_USER=${CRUNCHY_NAME}-${SUFFIX}-pguser-${CRUNCHY_NAME}-${SUFFIX} \ ${PROJ_TOOLS:+ "-p PROJ_TOOLS=${PROJ_TOOLS}"} \ ${IMAGE_REGISTRY:+ "-p IMAGE_REGISTRY=${IMAGE_REGISTRY}"}" diff --git a/openshift/scripts/oc_provision_wfwx_hourly_actuals_cronjob.sh b/openshift/scripts/oc_provision_wfwx_hourly_actuals_cronjob.sh index 1700f0a9b..aa90b5716 100755 --- a/openshift/scripts/oc_provision_wfwx_hourly_actuals_cronjob.sh +++ b/openshift/scripts/oc_provision_wfwx_hourly_actuals_cronjob.sh @@ -37,7 +37,7 @@ OC_PROCESS="oc -n ${PROJ_TARGET} process -f ${TEMPLATE_PATH}/wfwx_hourly_actuals -p SUFFIX=${SUFFIX} \ -p SCHEDULE=\"${SCHEDULE}\" \ -p POSTGRES_DATABASE=${POSTGRES_DATABASE:-${APP_NAME}} \ --p CRUNCHYDB_USER=wps-crunchydb-16-${SUFFIX}-pguser-wps-crunchydb-16-${SUFFIX} \ +-p CRUNCHYDB_USER=${CRUNCHY_NAME}-${SUFFIX}-pguser-${CRUNCHY_NAME}-${SUFFIX} \ ${PROJ_TOOLS:+ "-p PROJ_TOOLS=${PROJ_TOOLS}"} \ ${IMAGE_REGISTRY:+ "-p IMAGE_REGISTRY=${IMAGE_REGISTRY}"}" diff --git a/openshift/scripts/oc_provision_wfwx_noon_forecasts_cronjob.sh b/openshift/scripts/oc_provision_wfwx_noon_forecasts_cronjob.sh index 8fbd6e325..b5a3ac223 100755 --- a/openshift/scripts/oc_provision_wfwx_noon_forecasts_cronjob.sh +++ b/openshift/scripts/oc_provision_wfwx_noon_forecasts_cronjob.sh @@ -37,7 +37,7 @@ OC_PROCESS="oc -n ${PROJ_TARGET} process -f ${TEMPLATE_PATH}/wfwx_noon_forecasts -p SUFFIX=${SUFFIX} \ -p SCHEDULE=\"${SCHEDULE}\" \ -p POSTGRES_DATABASE=${POSTGRES_DATABASE:-${APP_NAME}} \ --p CRUNCHYDB_USER=wps-crunchydb-16-${SUFFIX}-pguser-wps-crunchydb-16-${SUFFIX} \ +-p CRUNCHYDB_USER=${CRUNCHY_NAME}-${SUFFIX}-pguser-${CRUNCHY_NAME}-${SUFFIX} \ ${PROJ_TOOLS:+ "-p PROJ_TOOLS=${PROJ_TOOLS}"} \ ${IMAGE_REGISTRY:+ "-p IMAGE_REGISTRY=${IMAGE_REGISTRY}"}" diff --git a/openshift/templates/crunchy.yaml b/openshift/templates/crunchy.yaml index 9002c9228..ab1b3424f 100644 --- a/openshift/templates/crunchy.yaml +++ b/openshift/templates/crunchy.yaml @@ -1,12 +1,12 @@ apiVersion: template.openshift.io/v1 kind: Template metadata: - name: ${APP_NAME}-${SUFFIX} + name: ${CRUNCHY_NAME}-${SUFFIX} annotations: - "openshift.io/display-name": ${APP_NAME}-${SUFFIX} + "openshift.io/display-name": ${CRUNCHY_NAME}-${SUFFIX} labels: - app.kubernetes.io/part-of: "${APP_NAME}" - app: ${APP_NAME}-${SUFFIX} + app.kubernetes.io/part-of: "${CRUNCHY_NAME}" + app: ${CRUNCHY_NAME}-${SUFFIX} parameters: - name: NAME description: | @@ -17,9 +17,8 @@ parameters: displayName: Target Namespace name: TARGET_NAMESPACE required: true - - name: APP_NAME + - name: CRUNCHY_NAME description: Application name (wps - wildfire predictive services) - value: wps-crunchydb-16 required: true - name: BUCKET description: S3 bucket name @@ -63,28 +62,28 @@ objects: init.sql: |- \c wps\\ CREATE EXTENSION postgis; - GRANT CREATE ON SCHEMA public TO "${APP_NAME}-${SUFFIX}"; + GRANT CREATE ON SCHEMA public TO "${CRUNCHY_NAME}-${SUFFIX}"; kind: ConfigMap metadata: labels: - app: ${APP_NAME}-${SUFFIX} + app: ${CRUNCHY_NAME}-${SUFFIX} name: wps-init-sql-${SUFFIX} - apiVersion: postgres-operator.crunchydata.com/v1beta1 kind: PostgresCluster metadata: - name: ${APP_NAME}-${SUFFIX} + name: ${CRUNCHY_NAME}-${SUFFIX} spec: postgresVersion: 16 postGISVersion: "3.3" metadata: - name: ${APP_NAME}-${SUFFIX} + name: ${CRUNCHY_NAME}-${SUFFIX} labels: - app: ${APP_NAME}-${SUFFIX} + app: ${CRUNCHY_NAME}-${SUFFIX} databaseInitSQL: key: init.sql name: wps-init-sql-${SUFFIX} users: - - name: ${APP_NAME}-${SUFFIX} + - name: ${CRUNCHY_NAME}-${SUFFIX} databases: - postgres - wps