You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
*`single`: Deploys an in-release Postgres/PostGIS StatefulSet with PgBouncer sidecar (no Crunchy operator resources).
163
+
*`crunchy`: Deploys Crunchy via `bcgov/action-crunchy` and wires the app to the Crunchy-generated service/secrets.
164
+
155
165
## 🔄 Updating Dependencies
156
166
157
167
Dependabot and Mend Renovate can both provide dependency updates using pull requests. Dependabot is simpler to configure, while Renovate is much more configurable and lighter on resources.
@@ -454,10 +464,14 @@ The starter stack includes a frontend (React, Bootstrap, Vite, Caddy), backend (
454
464
* 💪 [TypeScript](https://www.typescriptlang.org/) strong-typing for JavaScript
455
465
* 🏗️ [NestJS](https://docs.nestjs.com) Nest/Node backend and frontend
* 🐘 Single Postgres/PostGIS (default) with PgBouncer sidecar
458
470
* 🛡️ [OWASP Coraza WAF](https://github.com/corazawaf/coraza-caddy) Web Application Firewall integrated with Caddy
459
471
460
-
PostGIS is enabled by default for geospatial data support when postGISVersion value is provided. To switch to standard PostgreSQL, update the `postGISVersion` field in the [Crunchy Helm chart values](./charts/crunchy/values.yml) to `~`. This disables PostGIS extensions, making it a plain PostgreSQL setup.
472
+
PostGIS notes:
473
+
***Single mode** uses the repository-owned database image (built from `./database/Dockerfile`), currently targeting Postgres 18 + PostGIS.
474
+
***Crunchy mode** uses `charts/crunchy/values.yml`. PostGIS is enabled when `crunchy.postGISVersion` is set; to switch to standard PostgreSQL, set it to `~`.
461
475
462
476
### 🛡️ OWASP Coraza WAF: Application Security
463
477
@@ -504,9 +518,34 @@ The WAF is integrated directly into the Caddy web server, providing real-time pr
504
518
505
519
For more details, see the [Coraza documentation](https://coraza.io/docs/).
506
520
507
-
## 🗄️ Crunchy Database
521
+
## 🗄️ Database
522
+
523
+
This template supports two database providers. The provider is controlled via the repository variable `DB_PROVIDER` and is also passed into Helm as `global.database.provider`.
524
+
525
+
### 🐘 Single Postgres/PostGIS (default)
526
+
527
+
This mode deploys a NON-HA database **inside the application Helm release**:
528
+
529
+
* A Postgres/PostGIS **StatefulSet** and **Service** named `<release>-db`
530
+
* A **PgBouncer sidecar** (service port 5432 targets PgBouncer)
531
+
* Optional backups via a **CronJob** using the BCGov backup container (`ghcr.io/bcgov/backup-container`)
532
+
533
+
Images:
534
+
* Database image is built from `./database/Dockerfile` and published to GHCR (expected default: `ghcr.io/<org>/<repo>/database:<tag>`)
535
+
* PgBouncer image is built from `./pgbouncer/Dockerfile` and published to GHCR (expected default: `ghcr.io/<org>/<repo>/pgbouncer:<tag>`)
536
+
537
+
Backups (single mode):
538
+
* Enable with Helm values: `global.database.backup.enabled=true`
539
+
* Configure schedule/retention/PVC under `global.database.backup.*` in `charts/app/values.yaml`
540
+
* Optional object storage settings live under `global.database.backup.s3.*`
541
+
Pros:
542
+
* Simple to maintain, low resource consumption
543
+
Cons:
544
+
* Non HA: https://developer.gov.bc.ca/docs/default/component/platform-developer-docs/docs/automation-and-resiliency/app-resiliency-guidelines/#a-highly-available-application
545
+
546
+
### 🐘 Crunchy Database (optional)
508
547
509
-
Crunchy is the default choice for high availability (HA) Postgres/PostGIS databases in BC Government.
548
+
Crunchy is still the recommended choice for high availability (HA) Postgres/PostGIS databases in BC Government with its known pitfalls and drawbacks around operational overhead.
510
549
511
550
### 🌟 Key Features
512
551
- ⚡ Automatic failover with Patroni
@@ -521,11 +560,7 @@ Crunchy is the default choice for high availability (HA) Postgres/PostGIS databa
521
560
3.**🚨 DR Testing**: Disaster Recovery Testing is **`MANDATORY`** before go live.
522
561
523
562
### 💾 Enabling S3 Backups
524
-
To enable S3 backups/recovery, provide these parameters to the GitHub Action:
525
-
-`s3_access_key`
526
-
-`s3_secret_key`
527
-
-`s3_bucket`
528
-
-`s3_endpoint`
563
+
To enable S3 backups/recovery in Crunchy mode, configure `crunchy.pgBackRest.s3.*` in `charts/crunchy/values.yml` (or an environment-specific override values file).
529
564
530
565
> **Important**: Never reuse the same s3/object store, bucket path across different Crunchy deployments or instances (dev, test, prod)
0 commit comments